mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-19 08:50:42 +08:00
feat: add motor-controller as cover shutter
This commit is contained in:
parent
3a5b641ec7
commit
057b7a4ffb
@ -82,6 +82,8 @@ async def async_setup_entry(
|
|||||||
data.spec.device_class = CoverDeviceClass.CURTAIN
|
data.spec.device_class = CoverDeviceClass.CURTAIN
|
||||||
elif data.spec.name == 'window-opener':
|
elif data.spec.name == 'window-opener':
|
||||||
data.spec.device_class = CoverDeviceClass.WINDOW
|
data.spec.device_class = CoverDeviceClass.WINDOW
|
||||||
|
elif data.spec.name == 'motor-controller':
|
||||||
|
data.spec.device_class = CoverDeviceClass.SHUTTER
|
||||||
new_entities.append(
|
new_entities.append(
|
||||||
Cover(miot_device=miot_device, entity_data=data))
|
Cover(miot_device=miot_device, entity_data=data))
|
||||||
|
|
||||||
@ -145,7 +147,7 @@ class Cover(MIoTServiceEntity, CoverEntity):
|
|||||||
self._attr_supported_features |= (
|
self._attr_supported_features |= (
|
||||||
CoverEntityFeature.CLOSE)
|
CoverEntityFeature.CLOSE)
|
||||||
self._prop_motor_value_close = item.value
|
self._prop_motor_value_close = item.value
|
||||||
elif item.name in {'pause'}:
|
elif item.name in {'pause', 'stop'}:
|
||||||
self._attr_supported_features |= (
|
self._attr_supported_features |= (
|
||||||
CoverEntityFeature.STOP)
|
CoverEntityFeature.STOP)
|
||||||
self._prop_motor_value_pause = item.value
|
self._prop_motor_value_pause = item.value
|
||||||
|
|||||||
@ -319,7 +319,8 @@ SPEC_SERVICE_TRANS_MAP: dict[str, dict | str] = {
|
|||||||
},
|
},
|
||||||
'entity': 'cover'
|
'entity': 'cover'
|
||||||
},
|
},
|
||||||
'window-opener': 'curtain'
|
'window-opener': 'curtain',
|
||||||
|
'motor-controller': 'curtain'
|
||||||
}
|
}
|
||||||
|
|
||||||
"""SPEC_PROP_TRANS_MAP
|
"""SPEC_PROP_TRANS_MAP
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user