Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Dec 21, 2020
1 parent 1d74148 commit 908d4a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/jablotron100/jablotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def writer_thread() -> None:
self._create_pg_outputs()

def _create_sections(self, packet: bytes) -> None:
sections_states = Jablotron._parse_sections_states_packet(packet)
sections_states = Jablotron._convert_sections_states_packet_to_binary(packet)

for section, section_binary in sections_states.items():
section_hass_device = Jablotron._create_section_hass_device(section)
Expand Down Expand Up @@ -812,7 +812,7 @@ def _read_packets(self) -> None:
if Jablotron._is_sections_states_packet(packet):
in_service_mode = self.in_service_mode

self._parse_section_states_packet(packet)
self._parse_sections_states_packet(packet)

if in_service_mode != self.in_service_mode:
self._update_all_entities()
Expand Down Expand Up @@ -955,8 +955,8 @@ def _is_device_with_activity_sensor(self, number: int) -> bool:
DEVICE_SIREN_OUTDOOR,
]

def _parse_section_states_packet(self, packet: bytes) -> None:
sections_states = Jablotron._parse_sections_states_packet(packet)
def _parse_sections_states_packet(self, packet: bytes) -> None:
sections_states = Jablotron._convert_sections_states_packet_to_binary(packet)

for section, section_binary in sections_states.items():
section_state = Jablotron._parse_jablotron_section_state(section_binary)
Expand Down Expand Up @@ -1376,7 +1376,7 @@ def _is_device_state_packet_for_fault(packet_type: int) -> bool:
]

@staticmethod
def _parse_sections_states_packet(packet: bytes) -> Dict[int, str]:
def _convert_sections_states_packet_to_binary(packet: bytes) -> Dict[int, str]:
section_states = {}

for section in range(1, MAX_SECTIONS + 1):
Expand Down

0 comments on commit 908d4a8

Please sign in to comment.