Skip to content

Commit a265ecf

Browse files
authored
Add Shelly sensor translation (home-assistant#154106)
Signed-off-by: David Rapan <[email protected]>
1 parent d52749c commit a265ecf

File tree

7 files changed

+331
-215
lines changed

7 files changed

+331
-215
lines changed

homeassistant/components/shelly/entity.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ def async_setup_entry_rest(
295295
class BlockEntityDescription(EntityDescription):
296296
"""Class to describe a BLOCK entity."""
297297

298-
# BlockEntity does not support UNDEFINED or None,
299-
# restrict the type to str.
300-
name: str = ""
301-
302298
unit_fn: Callable[[dict], str] | None = None
303299
value: Callable[[Any], Any] = lambda val: val
304300
available: Callable[[Block], bool] | None = None
@@ -311,10 +307,6 @@ class BlockEntityDescription(EntityDescription):
311307
class RpcEntityDescription(EntityDescription):
312308
"""Class to describe a RPC entity."""
313309

314-
# BlockEntity does not support UNDEFINED or None,
315-
# restrict the type to str.
316-
name: str = ""
317-
318310
sub_key: str | None = None
319311

320312
value: Callable[[Any, Any], Any] | None = None
@@ -332,10 +324,6 @@ class RpcEntityDescription(EntityDescription):
332324
class RestEntityDescription(EntityDescription):
333325
"""Class to describe a REST entity."""
334326

335-
# BlockEntity does not support UNDEFINED or None,
336-
# restrict the type to str.
337-
name: str = ""
338-
339327
value: Callable[[dict, Any], Any] | None = None
340328

341329

homeassistant/components/shelly/icons.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"detected_objects": {
2727
"default": "mdi:account-group"
2828
},
29+
"detected_objects_with_channel_name": {
30+
"default": "mdi:account-group"
31+
},
2932
"gas_concentration": {
3033
"default": "mdi:gauge"
3134
},
@@ -38,9 +41,21 @@
3841
"lamp_life": {
3942
"default": "mdi:progress-wrench"
4043
},
44+
"left_slot_level": {
45+
"default": "mdi:bottle-tonic-outline"
46+
},
47+
"left_slot_vial": {
48+
"default": "mdi:scent"
49+
},
4150
"operation": {
4251
"default": "mdi:cog-transfer"
4352
},
53+
"right_slot_level": {
54+
"default": "mdi:bottle-tonic-outline"
55+
},
56+
"right_slot_vial": {
57+
"default": "mdi:scent"
58+
},
4459
"self_test": {
4560
"default": "mdi:progress-wrench"
4661
},
@@ -52,12 +67,6 @@
5267
},
5368
"valve_status": {
5469
"default": "mdi:valve"
55-
},
56-
"vial_level": {
57-
"default": "mdi:bottle-tonic-outline"
58-
},
59-
"vial_name": {
60-
"default": "mdi:scent"
6170
}
6271
},
6372
"switch": {

0 commit comments

Comments
 (0)