Merge branch 'dev' into bangolufsen

This commit is contained in:
Markus Jacobsen
2023-12-01 21:02:11 +01:00
committed by GitHub
6 changed files with 16 additions and 5 deletions

View File

@@ -122,9 +122,9 @@ class PowerwallDataManager:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Tesla Powerwall from a config entry.""" """Set up Tesla Powerwall from a config entry."""
http_session = requests.Session() http_session = requests.Session()
ip_address = entry.data[CONF_IP_ADDRESS] ip_address: str = entry.data[CONF_IP_ADDRESS]
password = entry.data.get(CONF_PASSWORD) password: str | None = entry.data.get(CONF_PASSWORD)
power_wall = Powerwall(ip_address, http_session=http_session) power_wall = Powerwall(ip_address, http_session=http_session)
try: try:
base_info = await hass.async_add_executor_job( base_info = await hass.async_add_executor_job(
@@ -184,7 +184,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
def _login_and_fetch_base_info( def _login_and_fetch_base_info(
power_wall: Powerwall, host: str, password: str power_wall: Powerwall, host: str, password: str | None
) -> PowerwallBaseInfo: ) -> PowerwallBaseInfo:
"""Login to the powerwall and fetch the base info.""" """Login to the powerwall and fetch the base info."""
if password is not None: if password is not None:

View File

@@ -7,6 +7,9 @@
"data": { "data": {
"host": "[%key:common::config_flow::data::host%]", "host": "[%key:common::config_flow::data::host%]",
"name": "[%key:common::config_flow::data::name%]" "name": "[%key:common::config_flow::data::name%]"
},
"data_description": {
"host": "The hostname or IP address of your TV."
} }
}, },
"confirm": { "confirm": {

View File

@@ -26,6 +26,9 @@
"data": { "data": {
"host": "[%key:common::config_flow::data::host%]" "host": "[%key:common::config_flow::data::host%]"
}, },
"data_description": {
"host": "The hostname or IP address of your SFR device."
},
"description": "Setting the credentials is optional, but enables additional functionality." "description": "Setting the credentials is optional, but enables additional functionality."
} }
} }

View File

@@ -19,6 +19,9 @@
"ssl": "[%key:common::config_flow::data::ssl%]", "ssl": "[%key:common::config_flow::data::ssl%]",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]" "verify_ssl": "[%key:common::config_flow::data::verify_ssl%]"
}, },
"data_description": {
"host": "The hostname or IP address of your SMA device."
},
"description": "Enter your SMA device information.", "description": "Enter your SMA device information.",
"title": "Set up SMA Solar" "title": "Set up SMA Solar"
} }

View File

@@ -7,6 +7,9 @@
"host": "[%key:common::config_flow::data::host%]", "host": "[%key:common::config_flow::data::host%]",
"port": "[%key:common::config_flow::data::port%]" "port": "[%key:common::config_flow::data::port%]"
}, },
"data_description": {
"host": "The hostname or IP address of your Snapcast server."
},
"title": "[%key:common::action::connect%]" "title": "[%key:common::action::connect%]"
} }
}, },

View File

@@ -153,8 +153,7 @@ class SynologyPhotosMediaSource(MediaSource):
ret = [] ret = []
for album_item in album_items: for album_item in album_items:
mime_type, _ = mimetypes.guess_type(album_item.file_name) mime_type, _ = mimetypes.guess_type(album_item.file_name)
assert isinstance(mime_type, str) if isinstance(mime_type, str) and mime_type.startswith("image/"):
if mime_type.startswith("image/"):
# Force small small thumbnails # Force small small thumbnails
album_item.thumbnail_size = "sm" album_item.thumbnail_size = "sm"
ret.append( ret.append(