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

Add binary sensor for online charger (#114) #115

Merged
merged 1 commit into from
Sep 19, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.7.2b1

* Add "online" binary entity in charger, #114
* Reduce the amount of logging from the API, #90
* Delete old stale devices, #89
* Changed "total_charger_power_session" to TOTAL, #87
Expand Down
14 changes: 11 additions & 3 deletions custom_components/zaptec/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ZapBinarySensorEntityDescription(BinarySensorEntityDescription):
name="Installation", # Special case, no translation
device_class=BinarySensorDeviceClass.CONNECTIVITY, # False=disconnected, True=connected
entity_category=const.EntityCategory.DIAGNOSTIC,
icon="mdi:home-lightning-bolt-outline",
icon="mdi:cloud",
has_entity_name=False,
cls=ZaptecBinarySensorWithAttrs,
),
Expand All @@ -84,7 +84,7 @@ class ZapBinarySensorEntityDescription(BinarySensorEntityDescription):
name="Circuit", # Special case, no translation
device_class=BinarySensorDeviceClass.CONNECTIVITY, # False=disconnected, True=connected
entity_category=const.EntityCategory.DIAGNOSTIC,
icon="mdi:orbit",
icon="mdi:cloud",
has_entity_name=False,
cls=ZaptecBinarySensorWithAttrs,
),
Expand All @@ -96,10 +96,18 @@ class ZapBinarySensorEntityDescription(BinarySensorEntityDescription):
name="Charger", # Special case, no translation
device_class=BinarySensorDeviceClass.CONNECTIVITY, # False=disconnected, True=connected
entity_category=const.EntityCategory.DIAGNOSTIC,
icon="mdi:ev-station",
icon="mdi:cloud",
has_entity_name=False,
cls=ZaptecBinarySensorWithAttrs,
),
ZapBinarySensorEntityDescription(
key="is_online",
translation_key="online",
device_class=BinarySensorDeviceClass.CONNECTIVITY, # False=disconnected, True=connected
entity_category=const.EntityCategory.DIAGNOSTIC,
icon="mdi:ev-station",
cls=ZaptecBinarySensor,
),
ZapBinarySensorEntityDescription(
key="is_authorization_required",
translation_key="authorization_required",
Expand Down
1 change: 1 addition & 0 deletions custom_components/zaptec/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"on": "Required"
}
},
"online": { "name": "Online" },
"permanent_cable_lock": { "name": "Permanent cable lock" }
},
"button": {
Expand Down