Add new Solaredge sensors (#34525)

* Changes to be committed:
	modified:   homeassistant/components/solaredge/const.py
	modified:   homeassistant/components/solaredge/sensor.py

Solaredge as recently changed its policy about local api access, so solaredge-local doesn't work with last firmware update for almost users.
Please check https://github.com/home-assistant/core.git

Anyway the solardge remote api is still working, but doesn't got some usefull sensor information as Power SelfConsumption, Power Exported, Power Imported.
With my update, I'll fetching API energy details where  we got these new sensors.

* Grammar/syntax fix

* Indentation fix

* Black formatting fix

* isort fix

* To force re-check

* Fix too-many-nested-blocks

* Fix indentation

* Fix Black formatting :D

* Fix Redefining built-in var

* Removed comment to force check
This commit is contained in:
terminet85 authored and GitHub committed 2020-06-23 09:06:31 -07:00
1 parent 6610bbe7bb
commit a004e6aa68
2 files changed
+113 -3

No files matched your search

+15 -3
View File
@@ -10,12 +10,13 @@ CONF_SITE_ID = "site_id"
DEFAULT_NAME = "SolarEdge"
OVERVIEW_UPDATE_DELAY = timedelta(minutes=10)
OVERVIEW_UPDATE_DELAY = timedelta(minutes=15)
DETAILS_UPDATE_DELAY = timedelta(hours=12)
INVENTORY_UPDATE_DELAY = timedelta(hours=12)
POWER_FLOW_UPDATE_DELAY = timedelta(minutes=10)
POWER_FLOW_UPDATE_DELAY = timedelta(minutes=15)
ENERGY_DETAILS_DELAY = timedelta(minutes=15)
SCAN_INTERVAL = timedelta(minutes=10)
SCAN_INTERVAL = timedelta(minutes=15)
# Supported overview sensor types:
# Key: ['json_key', 'name', unit, icon, default]
@@ -65,4 +66,15 @@ SENSOR_TYPES = {
"solar_power": ["PV", "Solar Power", None, "mdi:solar-power", False],
"grid_power": ["GRID", "Grid Power", None, "mdi:power-plug", False],
"storage_power": ["STORAGE", "Storage Power", None, "mdi:car-battery", False],
"purchased_power": ["Purchased", "Imported Power", None, "mdi:flash", False],
"production_power": ["Production", "Production Power", None, "mdi:flash", False],
"consumption_power": ["Consumption", "Cosumption Power", None, "mdi:flash", False],
"selfconsumption_power": [
"SelfConsumption",
"SelfConsumption Power",
None,
"mdi:flash",
False,
],
"feedin_power": ["FeedIn", "Exported Power", None, "mdi:flash", False],
}