Skip to content

Commit

Permalink
Improve program sensor
Browse files Browse the repository at this point in the history
Do not hide program value from device if inactive is true
  • Loading branch information
frimtec committed Dec 8, 2024
1 parent 12c31bf commit 6e13f4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions custom_components/vzug/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ class Program(StateBase):
@property
def native_value(self) -> StateType | date | datetime | Decimal:
device = self.coordinator.data.device
if device.get("Inactive") == "true":
if device.get("Program"):
return device.get("Program")
elif device.get("Inactive") == "true":
return "standby"
return device.get("Program")
else:
return "active"


class ProgramEndRaw(StateBase):
Expand Down
3 changes: 2 additions & 1 deletion custom_components/vzug/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"program": {
"name": "Programm",
"state": {
"standby": "Standby"
"standby": "Standby",
"active": "Aktiv"
}
},
"program_end": {
Expand Down
3 changes: 2 additions & 1 deletion custom_components/vzug/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"program": {
"name": "Program",
"state": {
"standby": "Standby"
"standby": "Standby",
"active": "Active"
}
},
"program_end": {
Expand Down
3 changes: 2 additions & 1 deletion custom_components/vzug/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"program": {
"name": "Programme",
"state": {
"standby": "Veille"
"standby": "Veille",
"active": "Actif"
}
},
"program_end": {
Expand Down

0 comments on commit 6e13f4b

Please sign in to comment.