Skip to content

Commit

Permalink
Add product code to manufacturer in device information
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Feb 20, 2024
1 parent 769a08c commit d422f28
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 8 deletions.
7 changes: 6 additions & 1 deletion custom_components/echonetlite/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
2 changes: 2 additions & 0 deletions custom_components/echonetlite/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ async def enumerate_instances(

manufacturer = state["manufacturer"]
host_product_code = state.get("product_code")
if type(host_product_code) == str:
host_product_code = str.strip(host_product_code)
if not isinstance(manufacturer, str):
# If unable to resolve the manufacturer,
# the raw identification number will be passed as int.
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def device_info(self):
)
},
"name": self._attr_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._eojgc][self._eojcc],
# "sw_version": "",
}
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down
7 changes: 6 additions & 1 deletion custom_components/echonetlite/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def device_info(self):
)
},
"name": self._device_name,
"manufacturer": self._connector._manufacturer,
"manufacturer": self._connector._manufacturer
+ (
" " + self._connector._host_product_code
if self._connector._host_product_code
else ""
),
"model": EOJX_CLASS[self._connector._instance._eojgc][
self._connector._instance._eojcc
],
Expand Down

0 comments on commit d422f28

Please sign in to comment.