Add Powerwalls integration (#32851)
* Create an integration for Powerwalls * Self review :: remove unused code * Remove debug * Update homeassistant/components/powerwall/__init__.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * _call_site_info to module level * Update homeassistant/components/powerwall/binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update tests/components/powerwall/test_binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/binary_sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * remove sensors that I added tests for from the comment * Update homeassistant/components/powerwall/config_flow.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/powerwall/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Switch to UNIT_PERCENTAGE * reduce code * Add test for import * Adjust tests * Add missing file Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
242aff9269
commit
5b4d2aed64
20 changed files with 990 additions and 0 deletions
40
homeassistant/components/powerwall/const.py
Normal file
40
homeassistant/components/powerwall/const.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""Constants for the Tesla Powerwall integration."""
|
||||
|
||||
DOMAIN = "powerwall"
|
||||
|
||||
POWERWALL_SITE_NAME = "site_name"
|
||||
|
||||
POWERWALL_OBJECT = "powerwall"
|
||||
POWERWALL_COORDINATOR = "coordinator"
|
||||
POWERWALL_SITE_INFO = "site_info"
|
||||
|
||||
UPDATE_INTERVAL = 60
|
||||
|
||||
ATTR_REGION = "region"
|
||||
ATTR_GRID_CODE = "grid_code"
|
||||
ATTR_FREQUENCY = "frequency"
|
||||
ATTR_ENERGY_EXPORTED = "energy_exported"
|
||||
ATTR_ENERGY_IMPORTED = "energy_imported"
|
||||
ATTR_INSTANT_AVERAGE_VOLTAGE = "instant_average_voltage"
|
||||
ATTR_NOMINAL_SYSTEM_POWER = "nominal_system_power_kW"
|
||||
|
||||
SITE_INFO_UTILITY = "utility"
|
||||
SITE_INFO_GRID_CODE = "grid_code"
|
||||
SITE_INFO_NOMINAL_SYSTEM_POWER_KW = "nominal_system_power_kW"
|
||||
SITE_INFO_NOMINAL_SYSTEM_ENERGY_KWH = "nominal_system_energy_kWh"
|
||||
SITE_INFO_REGION = "region"
|
||||
|
||||
POWERWALL_SITE_NAME = "site_name"
|
||||
|
||||
POWERWALL_API_METERS = "meters"
|
||||
POWERWALL_API_CHARGE = "charge"
|
||||
POWERWALL_API_GRID_STATUS = "grid_status"
|
||||
POWERWALL_API_SITEMASTER = "sitemaster"
|
||||
|
||||
POWERWALL_GRID_ONLINE = "SystemGridConnected"
|
||||
POWERWALL_CONNECTED_KEY = "connected_to_tesla"
|
||||
POWERWALL_RUNNING_KEY = "running"
|
||||
|
||||
|
||||
MODEL = "PowerWall 2"
|
||||
MANUFACTURER = "Tesla"
|
Loading…
Add table
Add a link
Reference in a new issue