Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sdesalve committed Sep 29, 2021
1 parent acf3964 commit 32dd7e8
Showing 1 changed file with 1 addition and 68 deletions.
69 changes: 1 addition & 68 deletions custom_components/zcsazzurro/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
DEFAULT_NAME = "ZCSAzzurro"
DEFAULT_VERIFY_SSL = False

SCAN_INTERVAL = timedelta(minutes=1)
SCAN_INTERVAL = timedelta(minutes=2)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
Expand Down Expand Up @@ -315,69 +315,6 @@ def extra_state_attributes(self):
}
except TypeError:
_LOGGER.error("Error cannot find all required keys: %s", self.dssoutput)
return {
"lastUpdated": False,
"thing.find": False,
"total": {
"energyGenerating": -1,
"energyCharging": -1,
"energyDischarging": -1,
"energyExporting": -1,
"energyImporting": -1,
"energyConsuming": -1,
"energyAutoconsuming": -1
},
"current": {
"energyGenerating": -1,
"powerGenerating": -1,
"batteryCycletime": -1,
"batterySoC": -1,
"powerCharging": -1,
"powerDischarging": -1,
"powerExporting": -1,
"powerImporting": -1,
"powerConsuming": -1,
"powerAutoconsuming": -1,
"energyCharging": -1,
"energyDischarging": -1,
"energyExporting": -1,
"energyImporting": -1,
"energyConsuming": -1,
"energyAutoconsuming": -1,
},
}
else:
return {
"lastUpdated": False,
"thing.find": False,
"total": {
"energyGenerating": -1,
"energyCharging": -1,
"energyDischarging": -1,
"energyExporting": -1,
"energyImporting": -1,
"energyConsuming": -1,
"energyAutoconsuming": -1
},
"current": {
"energyGenerating": -1,
"powerGenerating": -1,
"batteryCycletime": -1,
"batterySoC": -1,
"powerCharging": -1,
"powerDischarging": -1,
"powerExporting": -1,
"powerImporting": -1,
"powerConsuming": -1,
"powerAutoconsuming": -1,
"energyCharging": -1,
"energyDischarging": -1,
"energyExporting": -1,
"energyImporting": -1,
"energyConsuming": -1,
"energyAutoconsuming": -1,
},
}

async def async_update(self):
"""Get the latest data from the ZCSAzzurro API and updates the state."""
Expand All @@ -404,10 +341,6 @@ def _async_update_from_rest_data(self):
_LOGGER.debug("Erroneous JSON: %s", json_dict)
else:
_LOGGER.warning("Empty reply found when expecting JSON data")
self.dssoutput = None
self._state = False
except TypeError:
self.dssoutput = None
self._state = False
_LOGGER.error("Unable to fetch data from ZCSAzzurro. Response: %s", self.rest.data)

0 comments on commit 32dd7e8

Please sign in to comment.