mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Update version for smart-meter-texas to 0.4.7 (#54493)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
8570502681
commit
2932a3d6a7
@ -1,8 +1,9 @@
|
|||||||
"""The Smart Meter Texas integration."""
|
"""The Smart Meter Texas integration."""
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
import ssl
|
||||||
|
|
||||||
from smart_meter_texas import Account, Client
|
from smart_meter_texas import Account, Client, ClientSSLContext
|
||||||
from smart_meter_texas.exceptions import (
|
from smart_meter_texas.exceptions import (
|
||||||
SmartMeterTexasAPIError,
|
SmartMeterTexasAPIError,
|
||||||
SmartMeterTexasAuthError,
|
SmartMeterTexasAuthError,
|
||||||
@ -39,7 +40,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
password = entry.data[CONF_PASSWORD]
|
password = entry.data[CONF_PASSWORD]
|
||||||
|
|
||||||
account = Account(username, password)
|
account = Account(username, password)
|
||||||
smart_meter_texas_data = SmartMeterTexasData(hass, entry, account)
|
|
||||||
|
client_ssl_context = ClientSSLContext()
|
||||||
|
ssl_context = await client_ssl_context.get_ssl_context()
|
||||||
|
|
||||||
|
smart_meter_texas_data = SmartMeterTexasData(hass, entry, account, ssl_context)
|
||||||
try:
|
try:
|
||||||
await smart_meter_texas_data.client.authenticate()
|
await smart_meter_texas_data.client.authenticate()
|
||||||
except SmartMeterTexasAuthError:
|
except SmartMeterTexasAuthError:
|
||||||
@ -87,13 +92,17 @@ class SmartMeterTexasData:
|
|||||||
"""Manages coordinatation of API data updates."""
|
"""Manages coordinatation of API data updates."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, hass: HomeAssistant, entry: ConfigEntry, account: Account
|
self,
|
||||||
|
hass: HomeAssistant,
|
||||||
|
entry: ConfigEntry,
|
||||||
|
account: Account,
|
||||||
|
ssl_context: ssl.SSLContext,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the data coordintator."""
|
"""Initialize the data coordintator."""
|
||||||
self._entry = entry
|
self._entry = entry
|
||||||
self.account = account
|
self.account = account
|
||||||
websession = aiohttp_client.async_get_clientsession(hass)
|
websession = aiohttp_client.async_get_clientsession(hass)
|
||||||
self.client = Client(websession, account)
|
self.client = Client(websession, account, ssl_context=ssl_context)
|
||||||
self.meters: list = []
|
self.meters: list = []
|
||||||
|
|
||||||
async def setup(self):
|
async def setup(self):
|
||||||
|
@ -3,7 +3,7 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aiohttp import ClientError
|
from aiohttp import ClientError
|
||||||
from smart_meter_texas import Account, Client
|
from smart_meter_texas import Account, Client, ClientSSLContext
|
||||||
from smart_meter_texas.exceptions import (
|
from smart_meter_texas.exceptions import (
|
||||||
SmartMeterTexasAPIError,
|
SmartMeterTexasAPIError,
|
||||||
SmartMeterTexasAuthError,
|
SmartMeterTexasAuthError,
|
||||||
@ -28,10 +28,11 @@ async def validate_input(hass: core.HomeAssistant, data):
|
|||||||
|
|
||||||
Data has the keys from DATA_SCHEMA with values provided by the user.
|
Data has the keys from DATA_SCHEMA with values provided by the user.
|
||||||
"""
|
"""
|
||||||
|
client_ssl_context = ClientSSLContext()
|
||||||
|
ssl_context = await client_ssl_context.get_ssl_context()
|
||||||
client_session = aiohttp_client.async_get_clientsession(hass)
|
client_session = aiohttp_client.async_get_clientsession(hass)
|
||||||
account = Account(data["username"], data["password"])
|
account = Account(data["username"], data["password"])
|
||||||
client = Client(client_session, account)
|
client = Client(client_session, account, ssl_context)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await client.authenticate()
|
await client.authenticate()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Smart Meter Texas",
|
"name": "Smart Meter Texas",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/smart_meter_texas",
|
"documentation": "https://www.home-assistant.io/integrations/smart_meter_texas",
|
||||||
"requirements": ["smart-meter-texas==0.4.0"],
|
"requirements": ["smart-meter-texas==0.4.7"],
|
||||||
"codeowners": ["@grahamwetzler"],
|
"codeowners": ["@grahamwetzler"],
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
}
|
}
|
||||||
|
@ -2146,7 +2146,7 @@ sleepyq==0.8.1
|
|||||||
slixmpp==1.7.1
|
slixmpp==1.7.1
|
||||||
|
|
||||||
# homeassistant.components.smart_meter_texas
|
# homeassistant.components.smart_meter_texas
|
||||||
smart-meter-texas==0.4.0
|
smart-meter-texas==0.4.7
|
||||||
|
|
||||||
# homeassistant.components.smarthab
|
# homeassistant.components.smarthab
|
||||||
smarthab==0.21
|
smarthab==0.21
|
||||||
|
@ -1197,7 +1197,7 @@ slackclient==2.5.0
|
|||||||
sleepyq==0.8.1
|
sleepyq==0.8.1
|
||||||
|
|
||||||
# homeassistant.components.smart_meter_texas
|
# homeassistant.components.smart_meter_texas
|
||||||
smart-meter-texas==0.4.0
|
smart-meter-texas==0.4.7
|
||||||
|
|
||||||
# homeassistant.components.smarthab
|
# homeassistant.components.smarthab
|
||||||
smarthab==0.21
|
smarthab==0.21
|
||||||
|
Loading…
x
Reference in New Issue
Block a user