uduncanu / lywsd03mmc Goto Github PK
View Code? Open in Web Editor NEWPython library for Xiaomi Mijia LYWSD03MMC sensors
License: MIT License
Python library for Xiaomi Mijia LYWSD03MMC sensors
License: MIT License
References
I get the following error message
Bluetooth command failed (code: 10, error: No attribute found within the given range)
Please, support getting the data from the periodic (in my device every 2.5 seconds) advertisements, instead of establishing a BT connection, to keep battery usage low.
Line 18 in 97a8d4d
Is there a reason why I shouldn't use data.battery
here instead of client.battery
?
I find that using data.battery
is faster and as far as I can tell it returns the same numbers.
Please extend the structure SensorDataBattery with the voltage of the battery. The value is already present in the code, but it is not returned in SensorDataBattery.
def _process_sensor_data(self, data):
temperature, humidity, voltage = struct.unpack_from('<hBh', data)
temperature /= 100
voltage /= 1000
# Estimate the battery percentage remaining
battery = min(int(round((voltage - 2.1),2) * 100), 100) # 3.1 or above --> 100% 2.1 --> 0 %
self._data = SensorDataBattery(temperature=temperature, humidity=humidity, battery=battery)
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.