mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-18 16:10:44 +08:00
Compare commits
1 Commits
bd3f16e9ea
...
da88a2d5b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da88a2d5b3 |
@ -89,8 +89,4 @@ 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. True if the binary sensor is on, False otherwise."""
|
||||||
if self.spec.name == 'contact-state':
|
|
||||||
return self._value is False
|
|
||||||
elif self.spec.name == 'occupancy-status':
|
|
||||||
return bool(self._value)
|
|
||||||
return self._value is True
|
return self._value is True
|
||||||
|
|||||||
@ -1215,7 +1215,7 @@ class MipsLocalClient(_MipsClient):
|
|||||||
or 'eiid' not in msg
|
or 'eiid' not in msg
|
||||||
# or 'arguments' not in msg
|
# or 'arguments' not in msg
|
||||||
):
|
):
|
||||||
self.log_info('unknown event msg, %s', payload)
|
self.log_error('unknown event msg, %s', payload)
|
||||||
return
|
return
|
||||||
if 'arguments' not in msg:
|
if 'arguments' not in msg:
|
||||||
self.log_info('wrong event msg, %s', payload)
|
self.log_info('wrong event msg, %s', payload)
|
||||||
|
|||||||
@ -145,9 +145,3 @@ urn:miot-spec-v2:device:water-purifier:0000A013:roswan-lte01:1:0000D05A:
|
|||||||
unit: ppm
|
unit: ppm
|
||||||
prop.4.2:
|
prop.4.2:
|
||||||
unit: ppm
|
unit: ppm
|
||||||
urn:miot-spec-v2:device:relay:0000A03D:lumi-c2acn01:1:
|
|
||||||
prop.4.1:
|
|
||||||
unit: kWh
|
|
||||||
urn:miot-spec-v2:device:bath-heater:0000A028:xiaomi-s1:1:
|
|
||||||
prop.4.4:
|
|
||||||
name: fan-level-ventilation
|
|
||||||
|
|||||||
@ -48,7 +48,6 @@ Conversion rules of MIoT-Spec-V2 instance to Home Assistant entity.
|
|||||||
from homeassistant.components.sensor import SensorDeviceClass
|
from homeassistant.components.sensor import SensorDeviceClass
|
||||||
from homeassistant.components.sensor import SensorStateClass
|
from homeassistant.components.sensor import SensorStateClass
|
||||||
from homeassistant.components.event import EventDeviceClass
|
from homeassistant.components.event import EventDeviceClass
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
@ -455,28 +454,12 @@ SPEC_PROP_TRANS_MAP: dict = {
|
|||||||
'format': {'int', 'float'},
|
'format': {'int', 'float'},
|
||||||
'access': {'read'}
|
'access': {'read'}
|
||||||
},
|
},
|
||||||
'binary_sensor': {
|
|
||||||
'format': {'bool', 'int'},
|
|
||||||
'access': {'read'}
|
|
||||||
},
|
|
||||||
'switch': {
|
'switch': {
|
||||||
'format': {'bool'},
|
'format': {'bool'},
|
||||||
'access': {'read', 'write'}
|
'access': {'read', 'write'}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'properties': {
|
'properties': {
|
||||||
'submersion-state': {
|
|
||||||
'device_class': BinarySensorDeviceClass.MOISTURE,
|
|
||||||
'entity': 'binary_sensor'
|
|
||||||
},
|
|
||||||
'contact-state': {
|
|
||||||
'device_class': BinarySensorDeviceClass.DOOR,
|
|
||||||
'entity': 'binary_sensor'
|
|
||||||
},
|
|
||||||
'occupancy-status': {
|
|
||||||
'device_class': BinarySensorDeviceClass.OCCUPANCY,
|
|
||||||
'entity': 'binary_sensor',
|
|
||||||
},
|
|
||||||
'temperature': {
|
'temperature': {
|
||||||
'device_class': SensorDeviceClass.TEMPERATURE,
|
'device_class': SensorDeviceClass.TEMPERATURE,
|
||||||
'entity': 'sensor',
|
'entity': 'sensor',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user