1 """Base entities for Sense energy."""
3 from sense_energy
import ASyncSenseable
4 from sense_energy.sense_api
import SenseDevice
9 from .const
import ATTRIBUTION, DOMAIN, MDI_ICONS
10 from .coordinator
import SenseCoordinator
14 """Convert sense icon to mdi icon."""
15 return f
"mdi:{MDI_ICONS.get(sense_icon, "power-plug
")}"
19 """Base implementation of a Sense sensor."""
21 _attr_attribution = ATTRIBUTION
22 _attr_should_poll =
False
23 _attr_has_entity_name =
True
27 gateway: ASyncSenseable,
28 coordinator: SenseCoordinator,
29 sense_monitor_id: str,
32 """Initialize the Sense sensor."""
37 name=f
"Sense {sense_monitor_id}",
38 identifiers={(DOMAIN, sense_monitor_id)},
40 manufacturer=
"Sense Labs, Inc.",
41 configuration_url=
"https://home.sense.com",
46 """Base implementation of a Sense sensor."""
48 _attr_attribution = ATTRIBUTION
49 _attr_should_poll =
False
50 _attr_has_entity_name =
True
55 coordinator: SenseCoordinator,
56 sense_monitor_id: str,
59 """Initialize the Sense sensor."""
66 identifiers={(DOMAIN, f
"{sense_monitor_id}:{device.id}")},
68 manufacturer=
"Sense Labs, Inc.",
69 configuration_url=
"https://home.sense.com",
70 via_device=(DOMAIN, sense_monitor_id),
None __init__(self, SenseDevice device, SenseCoordinator coordinator, str sense_monitor_id, str unique_id)
None __init__(self, ASyncSenseable gateway, SenseCoordinator coordinator, str sense_monitor_id, str unique_id)
str sense_to_mdi(str sense_icon)