sector icon indicating copy to clipboard operation
sector copied to clipboard

Get Temperature

Open cerede2000 opened this issue 2 years ago • 1 comments

Hi, I have a smoke detector and several door opening shock detectors on my Sector Alarm installation. When I activate the temperature rise option, the initialization of the component fails.

After analysis and testing on the code side, there are several things that need to be corrected.

In the file coordinator.py line 266 I added exception handling to firstly correct the error during initialization : 263 to 268 : LOGGER.debug("Temps refreshed: %s", response_temp) for temp in response_temp: if serial := temp.get("SerialNo"): data[key]["temp"][serial]["temperature"] = temp.get( "Temprature" ) To : LOGGER.debug("Temps refreshed: %s", response_temp) for temp in response_temp: if serial := temp.get("SerialNo"): try: data[key]["temp"][serial]["temperature"] = temp.get( "Temprature" ) except Exception as e: LOGGER.error("Error on %s - %s", serial, e)

After this correction I noticed that the temperatures of my opening sensors were not present either. I modified like this coordinator.py: 169 : if self._update_sensors: LOGGER.debug("Trying to refresh temperatures") response_temp = await self._request( API_URL + f"/Panel/GetTemperatures?panelId={panel_id}" ) if not response_temp: LOGGER.debug("Could not retrieve temp data for panel %s", panel_id) else: LOGGER.debug("Temps refreshed: %s", response_temp) temp_dict = {} for temp in response_temp: temp_dict[temp.get("SerialNo")] = { "name": temp.get("Label"), "serial": temp.get("SerialNo"), } data[panel["PanelId"]]["temp"] = temp_dict

cerede2000 avatar Nov 20 '23 13:11 cerede2000

I had the same issue. Thanks for the fix. It only pulled half of my temp sensors tho.

Nolux avatar Dec 14 '23 20:12 Nolux