File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,22 @@ async def unload(self) -> None:
9292 self ._sense_subscription ()
9393 await super ().unload ()
9494
95+ # region Caching
9596 async def _load_defaults (self ) -> None :
9697 """Load default configuration settings."""
9798 await super ()._load_defaults ()
9899 self ._sense_statistics = SenseStatistics (
99100 temperature = 0.0 ,
100101 humidity = 0.0 ,
101102 )
103+ if self ._node_info .model is None :
104+ self ._node_info .model = "Sense"
105+ if self ._node_info .name is None :
106+ self ._node_info .name = f"Sense { self ._node_info .mac [- 5 :]} "
107+ if self ._node_info .firmware is None :
108+ self ._node_info .firmware = DEFAULT_FIRMWARE
109+
110+ # endregion
102111
103112 # region properties
104113
Original file line number Diff line number Diff line change @@ -84,6 +84,19 @@ async def unload(self) -> None:
8484 self ._switch_subscription ()
8585 await super ().unload ()
8686
87+ # region Caching
88+ async def _load_defaults (self ) -> None :
89+ """Load default configuration settings."""
90+ await super ()._load_defaults ()
91+ if self ._node_info .model is None :
92+ self ._node_info .model = "Switch"
93+ if self ._node_info .name is None :
94+ self ._node_info .name = f"Switch { self ._node_info .mac [- 5 :]} "
95+ if self ._node_info .firmware is None :
96+ self ._node_info .firmware = DEFAULT_FIRMWARE
97+
98+ # endregion
99+
87100 # region Properties
88101
89102 @property
You can’t perform that action at this time.
0 commit comments