Compare commits

...

5 Commits

Author SHA1 Message Date
Gerrett84
53e12c74ff
Merge e2c482686d into 672e5b3f5d 2025-02-28 20:25:38 +08:00
Li Shuzhen
672e5b3f5d
docs: update changelog and version to v0.2.0 (#783)
Some checks failed
Tests / check-rule-format (push) Has been cancelled
Validate / validate-hassfest (push) Has been cancelled
Validate / validate-hacs (push) Has been cancelled
Validate / validate-lint (push) Has been cancelled
Validate / validate-setup (push) Has been cancelled
2025-02-28 17:39:31 +08:00
Necroneco
417af787c4
fix: some event:motion-detected does not contain 'arguments' (#712) 2025-02-28 16:45:17 +08:00
Necroneco
6f058bf392
fix: fix sensor display precision (#708) 2025-02-28 16:43:41 +08:00
Gerrett84
e2c482686d
Fix wrong binary sensor state 2025-02-08 15:57:00 +01:00
5 changed files with 31 additions and 8 deletions

View File

@ -1,5 +1,26 @@
# CHANGELOG # CHANGELOG
## v0.2.0
This version has modified some default units of sensors. After updating, it may cause Home Assistant to pop up some compatibility warnings. You can re-add the integration to resolve it.
这个版本修改了一些传感器默认单位,更新后会导致 Home Assistant 弹出一些兼容性提示,您可以重新添加集成解决。
### Added
- Add prop trans rule for surge-power. [#595](https://github.com/XiaoMi/ha_xiaomi_home/pull/595)
- Support modify spec and value conversion. [#663](https://github.com/XiaoMi/ha_xiaomi_home/pull/663)
- Support the electric blanket. [#781](https://github.com/XiaoMi/ha_xiaomi_home/pull/781)
- Add device with motor-control service as cover entity. [#688](https://github.com/XiaoMi/ha_xiaomi_home/pull/688)
### Changed
- Update README file. [#681](https://github.com/XiaoMi/ha_xiaomi_home/pull/681) [#747](https://github.com/XiaoMi/ha_xiaomi_home/pull/747)
- Update CONTRIBUTING.md. [#681](https://github.com/XiaoMi/ha_xiaomi_home/pull/681)
- Refactor climate.py. [#614](https://github.com/XiaoMi/ha_xiaomi_home/pull/614)
### Fixed
- Fix variable name or comment errors & fix test_lan error. [#678](https://github.com/XiaoMi/ha_xiaomi_home/pull/678) [#690](https://github.com/XiaoMi/ha_xiaomi_home/pull/690)
- Fix water heater error & some type error. [#684](https://github.com/XiaoMi/ha_xiaomi_home/pull/684)
- Fix fan level with value-list & fan reverse [#689](https://github.com/XiaoMi/ha_xiaomi_home/pull/689)
- Fix sensor display precision [#708](https://github.com/XiaoMi/ha_xiaomi_home/pull/708)
- Fix event:motion-detected without arguments [#712](https://github.com/XiaoMi/ha_xiaomi_home/pull/712)
## v0.1.5b2 ## v0.1.5b2
### Added ### Added
- Support binary sensors to be displayed as text sensor entities and binary sensor entities. [#592](https://github.com/XiaoMi/ha_xiaomi_home/pull/592) - Support binary sensors to be displayed as text sensor entities and binary sensor entities. [#592](https://github.com/XiaoMi/ha_xiaomi_home/pull/592)

View File

@ -88,5 +88,5 @@ class BinarySensor(MIoTPropertyEntity, BinarySensorEntity):
@property @property
def is_on(self) -> bool: def is_on(self) -> bool:
"""On/Off state. True if the binary sensor is on, False otherwise.""" """On/Off state. False if the binary sensor is on, False otherwise."""
return self._value is True return self._value is False

View File

@ -25,7 +25,7 @@
"cryptography", "cryptography",
"psutil" "psutil"
], ],
"version": "v0.1.5b2", "version": "v0.2.0",
"zeroconf": [ "zeroconf": [
"_miot-central._tcp.local." "_miot-central._tcp.local."
] ]

View File

@ -1213,10 +1213,12 @@ class MipsLocalClient(_MipsClient):
or 'did' not in msg or 'did' not in msg
or 'siid' not in msg or 'siid' not in msg
or 'eiid' not in msg or 'eiid' not in msg
or 'arguments' not in msg # or 'arguments' not in msg
): ):
# self.log_error(f'on_event_msg, recv unknown msg, {payload}') # self.log_error(f'on_event_msg, recv unknown msg, {payload}')
return return
if 'arguments' not in msg:
msg['arguments'] = []
if handler: if handler:
self.log_debug('local, on event_occurred, %s', payload) self.log_debug('local, on event_occurred, %s', payload)
handler(msg, ctx) handler(msg, ctx)

View File

@ -540,7 +540,7 @@ class MIoTSpecProperty(_MIoTSpecBase):
self.unit = unit self.unit = unit
self.value_range = value_range self.value_range = value_range
self.value_list = value_list self.value_list = value_list
self.precision = precision or 1 self.precision = precision if precision is not None else 1
self.expr = expr self.expr = expr
self.spec_id = hash( self.spec_id = hash(