Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4.2.2

- name: Initialize CodeQL
uses: github/codeql-action/init@v3.29.3
uses: github/codeql-action/init@v3.29.4
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.29.3
uses: github/codeql-action/analyze@v3.29.4
with:
category: "/language:python"
2 changes: 1 addition & 1 deletion homeassistant/components/august/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
"documentation": "https://www.home-assistant.io/integrations/august",
"iot_class": "cloud_push",
"loggers": ["pubnub", "yalexs"],
"requirements": ["yalexs==8.10.0", "yalexs-ble==3.0.0"]
"requirements": ["yalexs==8.10.0", "yalexs-ble==3.1.0"]
}
10 changes: 10 additions & 0 deletions homeassistant/components/google_cloud/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,13 @@
"yue-Hant-HK",
"zu-ZA",
]

# This allows us to support HA's standard codes (e.g., zh-CN) while
# sending the correct code to the Google API (e.g., cmn-Hans-CN).
HA_TO_GOOGLE_STT_LANG_MAP = {
"zh-CN": "cmn-Hans-CN", # Chinese (Mandarin, Simplified, China)
"zh-HK": "yue-Hant-HK", # Chinese (Cantonese, Traditional, Hong Kong)
"zh-TW": "cmn-Hant-TW", # Chinese (Mandarin, Traditional, Taiwan)
"he-IL": "iw-IL", # Hebrew (Google uses 'iw' legacy code)
"nb-NO": "no-NO", # Norwegian Bokmål
}
16 changes: 13 additions & 3 deletions homeassistant/components/google_cloud/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from google.api_core.exceptions import GoogleAPIError, Unauthenticated
from google.api_core.retry import AsyncRetry
from google.cloud import speech_v1
from propcache.api import cached_property

from homeassistant.components.stt import (
AudioBitRates,
Expand All @@ -30,6 +31,7 @@
CONF_STT_MODEL,
DEFAULT_STT_MODEL,
DOMAIN,
HA_TO_GOOGLE_STT_LANG_MAP,
STT_LANGUAGES,
)

Expand Down Expand Up @@ -68,10 +70,14 @@ def __init__(
self._client = client
self._model = entry.options.get(CONF_STT_MODEL, DEFAULT_STT_MODEL)

@property
@cached_property
def supported_languages(self) -> list[str]:
"""Return a list of supported languages."""
return STT_LANGUAGES
# Combine the native Google languages and the standard HA languages.
# A set is used to automatically handle duplicates.
supported = set(STT_LANGUAGES)
supported.update(HA_TO_GOOGLE_STT_LANG_MAP.keys())
return sorted(supported)

@property
def supported_formats(self) -> list[AudioFormats]:
Expand Down Expand Up @@ -102,6 +108,10 @@ async def async_process_audio_stream(
self, metadata: SpeechMetadata, stream: AsyncIterable[bytes]
) -> SpeechResult:
"""Process an audio stream to STT service."""
language_code = HA_TO_GOOGLE_STT_LANG_MAP.get(
metadata.language, metadata.language
)

streaming_config = speech_v1.StreamingRecognitionConfig(
config=speech_v1.RecognitionConfig(
encoding=(
Expand All @@ -110,7 +120,7 @@ async def async_process_audio_stream(
else speech_v1.RecognitionConfig.AudioEncoding.LINEAR16
),
sample_rate_hertz=metadata.sample_rate,
language_code=metadata.language,
language_code=language_code,
model=self._model,
)
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/luftdaten/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"entity": {
"sensor": {
"pressure_at_sealevel": { "name": "Pressure at sealevel" }
"pressure_at_sealevel": { "name": "Pressure at sea level" }
}
}
}
2 changes: 1 addition & 1 deletion homeassistant/components/mjpeg/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mjpeg_url": "MJPEG URL",
"name": "[%key:common::config_flow::data::name%]",
"password": "[%key:common::config_flow::data::password%]",
"still_image_url": "Still Image URL",
"still_image_url": "Still image URL",
"username": "[%key:common::config_flow::data::username%]",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]"
}
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/modbus/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"stop": {
"name": "[%key:common::action::stop%]",
"description": "Stops modbus hub.",
"description": "Stops a Modbus hub.",
"fields": {
"hub": {
"name": "[%key:component::modbus::services::write_coil::fields::hub::name%]",
Expand All @@ -60,7 +60,7 @@
},
"restart": {
"name": "[%key:common::action::restart%]",
"description": "Restarts modbus hub (if running stop then start).",
"description": "Restarts a Modbus hub (if running, stops then starts).",
"fields": {
"hub": {
"name": "[%key:component::modbus::services::write_coil::fields::hub::name%]",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/music_assistant/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"description": "The source media player which has the queue you want to transfer. When omitted, the first playing player will be used."
},
"auto_play": {
"name": "Auto play",
"name": "Autoplay",
"description": "Start playing the queue on the target player. Omit to use the default behavior."
}
}
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/onkyo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["aioonkyo"],
"requirements": ["aioonkyo==0.2.0"],
"quality_scale": "bronze",
"requirements": ["aioonkyo==0.3.0"],
"ssdp": [
{
"manufacturer": "ONKYO",
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/rainbird/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"description": "Sets how long automatic irrigation is turned off.",
"fields": {
"config_entry_id": {
"name": "Rainbird Controller Configuration Entry",
"description": "The setting will be adjusted on the specified controller."
"name": "Rain Bird controller",
"description": "The configuration entry of the controller to adjust the setting."
},
"duration": {
"name": "Duration",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/samsungtv/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]",
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"auth_missing": "Home Assistant is not authorized to connect to this Samsung TV. Check your TV's External Device Manager settings to authorize Home Assistant.",
"id_missing": "This Samsung device doesn't have a SerialNumber.",
"id_missing": "This Samsung device doesn't have a serial number to identify it.",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"not_supported": "This Samsung device is currently not supported.",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/teslemetry/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"name": "European vehicle"
},
"right_hand_drive": {
"name": "Right hand drive"
"name": "Right-hand drive"
},
"located_at_home": {
"name": "Located at home"
Expand Down
12 changes: 6 additions & 6 deletions homeassistant/components/webostv/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"pairing": {
"title": "LG webOS TV Pairing",
"title": "LG webOS TV pairing",
"description": "Select **Submit** and accept the pairing request on your TV.\n\n![Image](/static/images/config_webos.png)"
},
"reauth_confirm": {
Expand All @@ -37,7 +37,7 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]",
"reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]",
"wrong_device": "The configured device is not the same found on this Hostname or IP address."
"wrong_device": "The configured device is not the same found at this hostname or IP address."
}
},
"options": {
Expand Down Expand Up @@ -70,7 +70,7 @@
"fields": {
"entity_id": {
"name": "Entity",
"description": "Name(s) of the webostv entities where to run the API method."
"description": "Name(s) of the webOS TV entities where to run the API method."
},
"button": {
"name": "Button",
Expand All @@ -92,7 +92,7 @@
},
"payload": {
"name": "Payload",
"description": "An optional payload to provide to the endpoint in the format of key value pair(s)."
"description": "An optional payload to provide to the endpoint in the format of key value pairs."
}
}
},
Expand All @@ -102,7 +102,7 @@
"fields": {
"entity_id": {
"name": "Entity",
"description": "Name(s) of the webostv entities to change sound output on."
"description": "Name(s) of the webOS TV entities to change sound output on."
},
"sound_output": {
"name": "Sound output",
Expand Down Expand Up @@ -134,7 +134,7 @@
"message": "Unknown trigger platform: {platform}"
},
"invalid_entity_id": {
"message": "Entity {entity_id} is not a valid webostv entity."
"message": "Entity {entity_id} is not a valid webOS TV entity."
},
"source_not_found": {
"message": "Source {source} not found in the sources list for {name}."
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/yale/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"documentation": "https://www.home-assistant.io/integrations/yale",
"iot_class": "cloud_push",
"loggers": ["socketio", "engineio", "yalexs"],
"requirements": ["yalexs==8.10.0", "yalexs-ble==3.0.0"]
"requirements": ["yalexs==8.10.0", "yalexs-ble==3.1.0"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/yalexs_ble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/yalexs_ble",
"iot_class": "local_push",
"requirements": ["yalexs-ble==3.0.0"]
"requirements": ["yalexs-ble==3.1.0"]
}
4 changes: 2 additions & 2 deletions requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion script/hassfest/quality_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,6 @@ class Rule:
"ombi",
"omnilogic",
"oncue",
"onkyo",
"ondilo_ico",
"onewire",
"onvif",
Expand Down
6 changes: 3 additions & 3 deletions tests/components/luftdaten/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ async def test_luftdaten_sensors(
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfPressure.PA
assert ATTR_ICON not in state.attributes

entry = entity_registry.async_get("sensor.sensor_12345_pressure_at_sealevel")
entry = entity_registry.async_get("sensor.sensor_12345_pressure_at_sea_level")
assert entry
assert entry.device_id
assert entry.unique_id == "12345_pressure_at_sealevel"

state = hass.states.get("sensor.sensor_12345_pressure_at_sealevel")
state = hass.states.get("sensor.sensor_12345_pressure_at_sea_level")
assert state
assert state.state == "103102.13"
assert (
state.attributes.get(ATTR_FRIENDLY_NAME) == "Sensor 12345 Pressure at sealevel"
state.attributes.get(ATTR_FRIENDLY_NAME) == "Sensor 12345 Pressure at sea level"
)
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.PRESSURE
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
Expand Down
2 changes: 1 addition & 1 deletion tests/components/webostv/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ async def test_trigger_invalid_entity_id(
},
)

assert f"Entity {invalid_entity} is not a valid {DOMAIN} entity" in caplog.text
assert f"Entity {invalid_entity} is not a valid webOS TV entity" in caplog.text
2 changes: 1 addition & 1 deletion tests/components/yalexs_ble/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_mock_push_lock():
mock_push_lock.wait_for_first_update = AsyncMock()
mock_push_lock.stop = AsyncMock()
mock_push_lock.lock_state = LockState(
LockStatus.UNLOCKED, DoorStatus.CLOSED, None, None
LockStatus.UNLOCKED, DoorStatus.CLOSED, None, None, None, None
)
mock_push_lock.lock_status = LockStatus.UNLOCKED
mock_push_lock.door_status = DoorStatus.CLOSED
Expand Down
Loading