Skip to content

Commit

Permalink
Merge pull request #114 from mattsaxon/issue#109
Browse files Browse the repository at this point in the history
Issue#109
  • Loading branch information
mattsaxon authored Mar 19, 2022
2 parents a024527 + e004823 commit 6886095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom_components/jablotron80/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities) -> None:
cu = hass.data[DOMAIN][config_entry.entry_id][DATA_JABLOTRON] # type: JA80CentralUnit
async_add_entities([JablotronDeviceSensorEntity(device,cu) for device in cu.devices], True)
async_add_entities([JablotronDeviceSensorEntity(cu.central_device,cu)], True)
async_add_entities([JablotronDeviceSensorEntity(led,cu) for led in cu.leds], True)
async_add_entities([JablotronDeviceSensorEntity(code,cu) for code in cu.codes], True)
async_add_entities([JablotronDeviceSensorEntity(cu.statustext,cu)], True)
Expand Down
5 changes: 3 additions & 2 deletions custom_components/jablotron80/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import traceback
import asyncio
import voluptuous as vol
from collections import OrderedDict
Expand Down Expand Up @@ -130,7 +131,7 @@ async def async_step_devices(self, user_input: Optional[Dict[str, Any]] = None)
for device in self._devices:
devices[device.id] = {"serial_number":device.serial_number,
"reaction":device.reaction,
"zone": device.zone.id,
"zone": device.zone.id if device.zone is not None else "None",
"model":device.model,
"manufacturer": device.manufacturer}
for input in sorted(user_input):
Expand All @@ -147,7 +148,7 @@ async def async_step_devices(self, user_input: Optional[Dict[str, Any]] = None)
return await self.async_step_codes()

except Exception as ex:
LOGGER.debug(format(ex))
LOGGER.error(f'Unexpected error: {traceback.format_exc()}')

return self.async_abort(reason="unknown")

Expand Down
4 changes: 2 additions & 2 deletions custom_components/jablotron80/jablotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ def is_code_required_for_arm(self) -> bool:

@property
def devices(self) -> List[JablotronDevice]:
return [self.get_device(i) for i in range(0,self._max_number_of_devices+1)]
return [self.get_device(i) for i in range(1,self._max_number_of_devices+1)]

@property
def zones(self) -> List[JablotronZone]:
Expand Down Expand Up @@ -2086,7 +2086,7 @@ def _process_settings(self, data: bytearray, packet_data: str) -> None:
# # use only zone A if unsplit system
# device.zone = self.zones[1]
#else:
device.zone = self.get_zone([data[6]])
device.zone = self.get_zone(data[6])
device.reaction = data[5]
elif setting_type_2 == 0x02:
# E6 06 02 00 01 01 01 39 FF
Expand Down

0 comments on commit 6886095

Please sign in to comment.