chore: initial baseline before refactoring
Initial snapshot of Home Assistant config (HAOS 2026.4.4)
prior to dashboard restructuring and helper YAML migration.
Pre-commit cleanup applied:
- Removed blueprints/switch_manager/ (9.4 MB stale, component already gone)
- Removed .storage/switch_manager
- Removed home-assistant.log.{1,old,fault}
- Removed zigbee2mqtt/configuration_backup_v{1..4}.yaml
- Removed zigbee2mqtt/database.db.tmp.2024-09-27 (1.5y old)
- Created empty themes/ to satisfy configuration.yaml include
.gitignore uses allowlist strategy for .storage/ to keep
all tokens, keys, and PINs out of version control.
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
from cx_const import Cover, DefaultActionsMapping, Light, Switch, Z2MLight
|
||||
from cx_core import (
|
||||
CoverController,
|
||||
LightController,
|
||||
SwitchController,
|
||||
Z2MLightController,
|
||||
)
|
||||
|
||||
|
||||
class TasmotaButtonZ2MLightController(Z2MLightController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Z2MLight.TOGGLE,
|
||||
"SINGLE": Z2MLight.TOGGLE,
|
||||
"DOUBLE": Z2MLight.ON_MIN_BRIGHTNESS,
|
||||
"TRIPLE": Z2MLight.SET_HALF_BRIGHTNESS,
|
||||
"QUAD": Z2MLight.ON_FULL_BRIGHTNESS,
|
||||
"PENTA": None,
|
||||
"HOLD": Z2MLight.HOLD_BRIGHTNESS_TOGGLE,
|
||||
"CLEAR": Z2MLight.RELEASE,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaSwitchZ2MLightController(Z2MLightController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Z2MLight.TOGGLE,
|
||||
"ON": Z2MLight.ON,
|
||||
"OFF": Z2MLight.OFF,
|
||||
"HOLD": Z2MLight.SET_HALF_BRIGHTNESS,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaButtonLightController(LightController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Light.TOGGLE,
|
||||
"SINGLE": Light.TOGGLE,
|
||||
"DOUBLE": Light.ON_MIN_BRIGHTNESS,
|
||||
"TRIPLE": Light.SET_HALF_BRIGHTNESS,
|
||||
"QUAD": Light.ON_FULL_BRIGHTNESS,
|
||||
"PENTA": None,
|
||||
"HOLD": Light.HOLD_BRIGHTNESS_TOGGLE,
|
||||
"CLEAR": Light.RELEASE,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaSwitchLightController(LightController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Light.TOGGLE,
|
||||
"ON": Light.ON,
|
||||
"OFF": Light.OFF,
|
||||
"HOLD": Light.ON_MIN_MAX_BRIGHTNESS,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaButtonSwitchController(SwitchController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Light.TOGGLE,
|
||||
"SINGLE": Switch.TOGGLE,
|
||||
"DOUBLE": Switch.ON,
|
||||
"TRIPLE": Switch.OFF,
|
||||
"QUAD": None,
|
||||
"PENTA": None,
|
||||
"HOLD": None,
|
||||
"CLEAR": None,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaSwitchSwitchController(SwitchController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Switch.TOGGLE,
|
||||
"ON": Switch.ON,
|
||||
"OFF": Switch.OFF,
|
||||
"HOLD": None,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaButtonCoverController(CoverController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Cover.TOGGLE_OPEN,
|
||||
"SINGLE": Cover.TOGGLE_OPEN,
|
||||
"DOUBLE": Cover.CLOSE,
|
||||
"TRIPLE": None,
|
||||
"QUAD": None,
|
||||
"PENTA": None,
|
||||
"HOLD": Cover.CLOSE,
|
||||
"CLEAR": None,
|
||||
}
|
||||
|
||||
|
||||
class TasmotaSwitchCoverController(CoverController):
|
||||
def get_tasmota_actions_mapping(self) -> DefaultActionsMapping:
|
||||
return {
|
||||
"TOGGLE": Cover.TOGGLE_OPEN,
|
||||
"ON": Cover.OPEN,
|
||||
"OFF": Cover.CLOSE,
|
||||
"HOLD": Cover.TOGGLE_CLOSE,
|
||||
}
|
||||
Reference in New Issue
Block a user