Search found 7 matches

by scy
Mon Jan 03, 2022 12:39 pm
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 20458

Re: Reading GATT Data from Xiaomi Flower Care

In case someone stumbles over this thread trying to parse the advertisement data from the Xiaomi LYWSDCGQ BLE Temperature/Humidity sensors, which work very similarly, I’m providing some code to parse their data. See the announcement thread or go directly to the library.
by scy
Mon Jan 03, 2022 12:34 pm
Forum: Drivers for External Components
Topic: Announcing: Library to parse Xiaomi Mijia LYWSDCGQ Temperature/Humidity sensor BLE broadcasts
Replies: 0
Views: 14182

Announcing: Library to parse Xiaomi Mijia LYWSDCGQ Temperature/Humidity sensor BLE broadcasts

Hi everyone! I own some Xiaomi Mijia BLE temperature/humidity sensors and recently noticed in the ESPHome docs that you don’t have to connect to them in order to retrieve the current readings, they’re being broadcast in the advertisement packets. Since I’d like to access these sensors from a board r...
by scy
Tue Oct 20, 2020 8:37 am
Forum: General Discussion and Questions
Topic: Assigning to an objects __dict__: TypeError
Replies: 6
Views: 4736

Re: Assigning to an objects __dict__: TypeError

I don't think there's any __setattr__ changes currently in the pipeline? I don’t know, but #6427 unix/mpconfigport: Enable MICROPY_PY_DELATTR_SETATTR looks to me as if the flag to enable the current __setattr__ implementation, that is currently only active for the STM32 port, might be switched on f...
by scy
Sun Oct 11, 2020 5:46 pm
Forum: General Discussion and Questions
Topic: Assigning to an objects __dict__: TypeError
Replies: 6
Views: 4736

Re: Assigning to an objects __dict__: TypeError

I assume you've read the differences doc . Oh! No, in fact I did not, thanks for pointing me to it. I’ve just read the MicroPython differences from CPython page in the docs on the website, didn’t even know that there was additional content in the GitHub wiki. That definitely explains it, and it has...
by scy
Fri Oct 09, 2020 6:26 pm
Forum: General Discussion and Questions
Topic: Assigning to an objects __dict__: TypeError
Replies: 6
Views: 4736

Assigning to an objects __dict__: TypeError

Hi there! I’m currently trying out several things to work around MicroPython not supporting __setattr__ on ESP32 . One of them requires writing to an instance’s __dict__ . However, neither updating an existing value nor creating a new one works: class Foo: def __init__(self): self.a = 123 f = Foo() ...
by scy
Sat Sep 05, 2020 11:08 am
Forum: General Discussion and Questions
Topic: uasyncio: Schedule a task to run _now_
Replies: 5
Views: 3471

Re: uasyncio: Schedule a task to run _now_

If you issue uasyncio.create_task(foo()) foo will run immediately. The fact that other tasks are waiting using await uasyncio.sleep(t) will not affect the startup. I’m sorry, but that’s not the behavior I’m seeing. I guess it’s easier with a minimal example. Take this code: import uasyncio from mac...
by scy
Sat Sep 05, 2020 1:24 am
Forum: General Discussion and Questions
Topic: uasyncio: Schedule a task to run _now_
Replies: 5
Views: 3471

uasyncio: Schedule a task to run _now_

Hey there! I’ve been trying to write some debouncing code (on an ESP32, fwiw) using uasyncio and interrupts. The basic idea is as follows: Bind an interrupt handler to the pin. This interrupt handler then notes down the utime.ticks_ms() when the interrupt occured and then uses micropython.schedule t...