-
Notifications
You must be signed in to change notification settings - Fork 20
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
TypeError: expected string or bytes-like object #22
Comments
There appears to be two issues with my Carrier Infinity thermostat status. It is not returning local_time and zone_conditioning (this is marked as "off" under config). I was able to patch a couple of things in climate.py to get it going. Here's what I did: (1) set local_time to current time (2) changed the way _hvac_action is set i.e. changed it to _self.hvac_action = get_safe(self.system_status, "mode"). |
@zraken: can you please share your patches, my stat does not return local_time either |
Here's my crappy patch based on this version: https://github.com/MizterB/homeassistant-infinitude/blob/6a1b4985104354e6d7a6c72ab4f2f1e903a65ad3/custom_components/infinitude/climate.py:
|
I had a similar issue setting up this integration yesterday. Here is my patch: --- a/custom_components/infinitude/climate.py
+++ b/custom_components/infinitude/climate.py
@@ -276,7 +276,7 @@ class InfinitudeZone(ClimateEntity):
self.zone_name = get_safe(self.zone_status, "name")
self._temperature_unit = get_safe(self.system_config, "cfgem")
self._current_temperature = float(get_safe(self.zone_status, "rt"))
- self._hvac_action = get_safe(self.zone_status, "zoneconditioning")
+ self._hvac_action = get_safe(self.system_status, "mode")
self._current_humidity = float(get_safe(self.zone_status, "rh"))
self._hvac_mode = get_safe(self.system_config, "mode")
self.hold_state = get_safe(self.zone_config, "hold")
@@ -339,11 +339,14 @@ class InfinitudeZone(ClimateEntity):
# Current timestamp can include a TZ offset in some systems. It should be stripped off
# since the timestamp is already in the local time.
local_time = get_safe(self.system_status, "localTime")
- matches = re.match(
- r"^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})([+-]\d{2}:\d{2})?$", local_time
- )
- local_time = matches.group(1)
- dt = datetime.datetime.strptime(local_time, "%Y-%m-%dT%H:%M:%S")
+ try:
+ matches = re.match(
+ r"^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})([+-]\d{2}:\d{2})?$", local_time
+ )
+ local_time = matches.group(1)
+ dt = datetime.datetime.strptime(local_time, "%Y-%m-%dT%H:%M:%S")
+ except TypeError:
+ dt = datetime.datetime.now()
while self.activity_next is None:
day_name = dt.strftime("%A") |
I'm trying a plain vanilla install with all default options but ran into this error:
log file
configuration
response from infinitude for api/status (I don't see 'localTime'):
The text was updated successfully, but these errors were encountered: