Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix entity names to avoid breaking change introduced in Home Assistant 2023.8 #61

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 31 additions & 32 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pylint = "2.17.5"
pytest = "7.4.0"
pytest-asyncio = "0.21.1"
pytest-cov = "4.1.0"
ruff = "0.0.281"
ruff = "0.0.282"
safety = "2.4.0b1"
types-cachetools = "^5.3.0"
yamllint = "1.32.0"
Expand Down
2 changes: 1 addition & 1 deletion src/redreactor/components/homeassistant/homeassistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _process_homeassistant_configuration(self, static_configuration: Any) -> Non
field = static_configuration["fields"][field] # noqa: PLW2901

configuring: Base = Base(
name=f"{configuration_defaults.name} {field.get('pretty')}",
name=f"{field.get('pretty')}",
device_class=field.get("device_class", None),
state_class="measurement",
expire_after=int(static_configuration["homeassistant"]["expire_after"]),
Expand Down
16 changes: 8 additions & 8 deletions src/redreactor/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,21 @@ def _load(self) -> dict[str, Any]:
},
"battery_level": {
"name": "battery_level",
"pretty": "Battery Level",
"pretty": "Battery level",
"type": "sensor",
"unit": "%",
"device_class": "battery",
},
"external_power": {
"name": "external_power",
"pretty": "External Power",
"pretty": "External power",
"type": "binary_sensor",
"device_class": "plug",
"entity_category": "diagnostic",
},
"cpu_temperature": {
"name": "cpu_temperature",
"pretty": "CPU Temperature",
"pretty": "CPU temperature",
"type": "sensor",
"unit": "°C",
"device_class": "temperature",
Expand All @@ -159,13 +159,13 @@ def _load(self) -> dict[str, Any]:
},
"cpu_stat": {
"name": "cpu_stat",
"pretty": "CPU Stat",
"pretty": "CPU stat",
"type": "sensor",
"entity_category": "diagnostic",
},
"battery_warning_threshold": {
"name": "battery_warning_threshold",
"pretty": "Battery Warning",
"pretty": "Battery warning",
"type": "number",
"unit": "%",
"device_class": "battery",
Expand All @@ -177,7 +177,7 @@ def _load(self) -> dict[str, Any]:
},
"battery_voltage_minimum": {
"name": "battery_voltage_minimum",
"pretty": "Battery Voltage Minimum",
"pretty": "Battery voltage minimum",
"type": "number",
"unit": "V",
"device_class": "voltage",
Expand All @@ -189,7 +189,7 @@ def _load(self) -> dict[str, Any]:
},
"battery_voltage_maximum": {
"name": "battery_voltage_maximum",
"pretty": "Battery Voltage Maximum",
"pretty": "Battery voltage maximum",
"type": "number",
"unit": "V",
"device_class": "voltage",
Expand All @@ -201,7 +201,7 @@ def _load(self) -> dict[str, Any]:
},
"report_interval": {
"name": "report_interval",
"pretty": "Report Interval",
"pretty": "Report interval",
"type": "number",
"unit": "s",
"entity_category": "diagnostic",
Expand Down