Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dewdropawoo authored Dec 4, 2023
2 parents f9566b4 + 157c4e3 commit 7eebcdf
Show file tree
Hide file tree
Showing 101 changed files with 1,488 additions and 159 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/automation/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from homeassistant.components import blueprint
from homeassistant.components.trace import TRACE_CONFIG_SCHEMA
from homeassistant.config import config_without_domain
from homeassistant.config import config_per_platform, config_without_domain
from homeassistant.const import (
CONF_ALIAS,
CONF_CONDITION,
Expand All @@ -21,7 +21,7 @@
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_platform, config_validation as cv, script
from homeassistant.helpers import config_validation as cv, script
from homeassistant.helpers.condition import async_validate_conditions_config
from homeassistant.helpers.trigger import async_validate_trigger_config
from homeassistant.helpers.typing import ConfigType
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/balboa/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "Hostname or IP address of your Balboa Spa Wifi Device. For example, 192.168.1.58."
"host": "Hostname or IP address of your Balboa Spa Wi-Fi Device. For example, 192.168.1.58."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"bluetooth-adapters==0.16.1",
"bluetooth-auto-recovery==1.2.3",
"bluetooth-data-tools==1.17.0",
"dbus-fast==2.14.0",
"dbus-fast==2.20.0",
"habluetooth==0.5.1"
]
}
2 changes: 1 addition & 1 deletion homeassistant/components/bmw_connected_drive/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/bmw_connected_drive",
"iot_class": "cloud_polling",
"loggers": ["bimmer_connected"],
"requirements": ["bimmer-connected[china]==0.14.5"]
"requirements": ["bimmer-connected[china]==0.14.6"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/bond/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from homeassistant.helpers import entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from .const import DOMAIN, SERVICE_SET_FAN_SPEED_TRACKED_STATE
from .entity import BondEntity
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/comfoconnect/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from . import DOMAIN, SIGNAL_COMFOCONNECT_UPDATE_RECEIVED, ComfoConnectBridge

Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/device_tracker/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
from homeassistant import util
from homeassistant.backports.functools import cached_property
from homeassistant.components import zone
from homeassistant.config import async_log_schema_error, load_yaml_config_file
from homeassistant.config import (
async_log_schema_error,
config_per_platform,
load_yaml_config_file,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_GPS_ACCURACY,
Expand All @@ -33,7 +37,6 @@
from homeassistant.core import Event, HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import (
config_per_platform,
config_validation as cv,
discovery,
entity_registry as er,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"documentation": "https://www.home-assistant.io/integrations/frontend",
"integration_type": "system",
"quality_scale": "internal",
"requirements": ["home-assistant-frontend==20231130.0"]
"requirements": ["home-assistant-frontend==20231204.0"]
}
8 changes: 2 additions & 6 deletions homeassistant/components/homeassistant/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
callback,
)
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import (
config_per_platform,
config_validation as cv,
entity_platform,
)
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback, EntityPlatform
from homeassistant.helpers.service import (
async_extract_entity_ids,
Expand Down Expand Up @@ -208,7 +204,7 @@ async def reload_config(call: ServiceCall) -> None:
await platform.async_reset()

# Extract only the config for the Home Assistant platform, ignore the rest.
for p_type, p_config in config_per_platform(conf, SCENE_DOMAIN):
for p_type, p_config in conf_util.config_per_platform(conf, SCENE_DOMAIN):
if p_type != HA_DOMAIN:
continue

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hue/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your Hue bridge."
"host": "[%key:component::hue::config::step::init::data_description::host%]"
}
},
"link": {
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/isy994/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from .const import _LOGGER, DOMAIN
from .entity import ISYNodeEntity, ISYProgramEntity
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/knx/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from .const import DATA_KNX_CONFIG, DOMAIN, KNX_ADDRESS
from .knx_entity import KnxEntity
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/lifx/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"description": "If you leave the host empty, discovery will be used to find devices.",
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your LIFX device."
}
},
"pick_device": {
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/lutron_caseta/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"description": "Enter the IP address of the device.",
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your Lutron Caseta Smart Bridge."
}
},
"link": {
Expand Down
7 changes: 2 additions & 5 deletions homeassistant/components/mailbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@

from homeassistant.components import frontend
from homeassistant.components.http import HomeAssistantView
from homeassistant.config import config_per_platform
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import (
config_per_platform,
config_validation as cv,
discovery,
)
from homeassistant.helpers import config_validation as cv, discovery
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/modern_forms/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from homeassistant.helpers import entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from . import (
ModernFormsDataUpdateCoordinator,
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/modern_forms/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"description": "Set up your Modern Forms fan to integrate with Home Assistant.",
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your Modern Forms fan."
}
},
"zeroconf_confirm": {
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/moehlenhoff_alpha2/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"user": {
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your Möhlenhoff Alpha2 system."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
from homeassistant.helpers.template import Template
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
ranged_value_to_percentage,
)
from homeassistant.util.scaling import int_states_in_range

from . import subscription
from .config import MQTT_RW_SCHEMA
Expand Down
19 changes: 9 additions & 10 deletions homeassistant/components/mqtt/light/schema_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from contextlib import suppress
import logging
from typing import Any, cast
from typing import TYPE_CHECKING, Any, cast

import voluptuous as vol

Expand Down Expand Up @@ -367,10 +367,10 @@ def state_received(msg: ReceiveMessage) -> None:
if brightness_supported(self.supported_color_modes):
try:
if brightness := values["brightness"]:
scale = self._config[CONF_BRIGHTNESS_SCALE]
self._attr_brightness = min(
255,
round(brightness * 255 / scale), # type: ignore[operator]
if TYPE_CHECKING:
assert isinstance(brightness, float)
self._attr_brightness = color_util.value_to_brightness(
(1, self._config[CONF_BRIGHTNESS_SCALE]), brightness
)
else:
_LOGGER.debug(
Expand Down Expand Up @@ -591,13 +591,12 @@ async def async_turn_on(self, **kwargs: Any) -> None: # noqa: C901
self._set_flash_and_transition(message, **kwargs)

if ATTR_BRIGHTNESS in kwargs and self._config[CONF_BRIGHTNESS]:
brightness_normalized = kwargs[ATTR_BRIGHTNESS] / DEFAULT_BRIGHTNESS_SCALE
brightness_scale = self._config[CONF_BRIGHTNESS_SCALE]
device_brightness = min(
round(brightness_normalized * brightness_scale), brightness_scale
device_brightness = color_util.brightness_to_value(
(1, self._config[CONF_BRIGHTNESS_SCALE]),
kwargs[ATTR_BRIGHTNESS],
)
# Make sure the brightness is not rounded down to 0
device_brightness = max(device_brightness, 1)
device_brightness = max(round(device_brightness), 1)
message["brightness"] = device_brightness

if self._optimistic:
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/mutesync/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"user": {
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your mutesync device."
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/mystrom/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"data": {
"name": "[%key:common::config_flow::data::name%]",
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your myStrom device."
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/nanoleaf/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"user": {
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of your Nanoleaf device."
}
},
"link": {
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/netgear/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"host": "[%key:common::config_flow::data::host%]",
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"host": "The hostname or IP address of your Netgear device. For example: '192.168.1.1'."
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/nfandroidtv/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"data": {
"host": "[%key:common::config_flow::data::host%]",
"name": "[%key:common::config_flow::data::name%]"
},
"data_description": {
"host": "The hostname or IP address of your TV."
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/notify/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
from functools import partial
from typing import Any, Protocol, cast

from homeassistant.config import config_per_platform
from homeassistant.const import CONF_DESCRIPTION, CONF_NAME
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_platform, discovery
from homeassistant.helpers import discovery
from homeassistant.helpers.service import async_set_service_schema
from homeassistant.helpers.template import Template
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/nuki/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"port": "[%key:common::config_flow::data::port%]",
"token": "[%key:common::config_flow::data::access_token%]",
"encrypt_token": "Use an encrypted token for authentication."
},
"data_description": {
"host": "The hostname or IP address of your Nuki bridge. For example: 192.168.1.25."
}
},
"reauth_confirm": {
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/nut/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"config": {
"step": {
"user": {
"title": "Connect to the NUT server",
"description": "Connect to the NUT server",
"data": {
"host": "[%key:common::config_flow::data::host%]",
"port": "[%key:common::config_flow::data::port%]",
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"host": "The hostname or IP address of your NUT server."
}
},
"ups": {
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/obihai/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"host": "[%key:common::config_flow::data::host%]",
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"host": "The hostname or IP address of your Obihai device."
}
},
"dhcp_confirm": {
Expand All @@ -14,6 +17,9 @@
"host": "[%key:common::config_flow::data::host%]",
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"host": "[%key:component::obihai::config::step::user::data_description::host%]"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/octoprint/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"ssl": "[%key:common::config_flow::data::ssl%]",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"host": "The hostname or IP address of your printer."
}
},
"reauth_confirm": {
Expand Down
Loading

0 comments on commit 7eebcdf

Please sign in to comment.