Skip to content
Open
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
14 changes: 14 additions & 0 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate with hassfest

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "home-assistant/actions/hassfest@master"
19 changes: 0 additions & 19 deletions .github/workflows/rebase_dependencies.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Validate

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

permissions: {}

jobs:
validate-hacs:
runs-on: "ubuntu-latest"
steps:
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ is required, you need to obtain it in the 'Govee Home' app on your mobile device

A lot of effort is going into that integration. So if you can afford it and want to support us:

<a href="https://www.buymeacoffee.com/LaggAt" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<a href="https://www.buymeacoffee.com/theogre" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

Thank you!

## Is it stable?

We think so. It is used often, and the support thread is active.

![usage statistics per version](https://raw.githubusercontent.com/LaggAt/actions/main/output/goveestats_installations.png)
![usage statistics per version](https://raw.githubusercontent.com/TheOneOgre/actions/main/output/goveestats_installations.png)

Usage Data is taken from Home Assistant analytics, and plotted over time by us. You need to enable analytics if you want to show here.

## Is there an issue right now?

This graph uses the same library to do simple checks. If you see round dots on the right of the graph (= today), probably there is an issue.

![Govee API running?](https://raw.githubusercontent.com/LaggAt/actions/main/output/govee-api-up.png)
![Govee API running?](https://raw.githubusercontent.com/TheOneOgre/actions/main/output/govee-api-up.png)

## Pulling or assuming state

Expand All @@ -53,7 +53,7 @@ We can have state from two sources: 'API' and 'HISTORY'. History for example mea
So let's say we have an issue, that the ON/OFF state from API is wrong, we always get OFF. (This happended, and this is why I developed that feature). If we disable the power state we get from API we could work around this, and thats exactly what we do:

1. 'API' or 'History': state from which source do we want to disable? In our example the API state is wrong, as we could see in logs, so we choose 'API'
2. Look up the attribute you want to disable in GoveeDevice data class. Don't worry, you don't need to understand any of the code here. [Here is that data class (click)](https://github.com/LaggAt/python-govee-api/blob/master/govee_api_laggat/govee_dtos.py). In our Example we will find 'power_state'
2. Look up the attribute you want to disable in GoveeDevice data class. Don't worry, you don't need to understand any of the code here. [Here is that data class (click)](https://github.com/TheOneOgre/python-govee-api/blob/master/govee_api_laggat/govee_dtos.py). In our Example we will find 'power_state'
3. Next, in Home Assistant we open Configuration - Integrations and click on the options on the Govee integration. Here is an example how this config option could look:

![DISABLE state updates option](https://community-assets.home-assistant.io/original/3X/6/c/6cffe0de8b100ef4efc0e460482ff659b8f9444c.png)
Expand Down
7 changes: 5 additions & 2 deletions custom_components/govee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
await async_unload_entry(hass, entry)
raise PlatformNotReady()

for component in PLATFORMS:
await hass.config_entries.async_forward_entry_setup(entry, component)
try:
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
except ImportError as exc:
logging.error("Platform not found ({}).".format(exc))
return False

return True

Expand Down
23 changes: 17 additions & 6 deletions custom_components/govee/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import timedelta, datetime
import logging

from homeassistant.util.color import value_to_brightness
from propcache import cached_property

from govee_api_laggat import Govee, GoveeDevice, GoveeError
Expand All @@ -27,7 +28,6 @@
COLOR_TEMP_KELVIN_MAX,
)


_LOGGER = logging.getLogger(__name__)


Expand Down Expand Up @@ -156,6 +156,18 @@ def _state(self):
"""Lights internal state."""
return self._device # self._hub.state(self._device)

@property
def color_mode(self) -> ColorMode:
"""Get color mode."""
current = list(self._device.color)
if self._device.color_temp > 0:
return ColorMode.COLOR_TEMP
if list([0, 0, 0]) != current:
return ColorMode.HS
if self._device.brightness > 0:
return ColorMode.BRIGHTNESS
return ColorMode.ONOFF

@cached_property
def supported_color_modes(self) -> set[ColorMode]:
"""Get supported color modes."""
Expand Down Expand Up @@ -289,23 +301,22 @@ def rgb_color(self):
@property
def brightness(self):
"""Return the brightness value."""
# govee is reporting 0 to 254 - home assistant uses 1 to 255
return self._device.brightness + 1
return value_to_brightness((0, 254), self._device.brightness)

@property
def color_temp(self):
def color_temp_kelvin(self):
"""Return the color_temp of the light."""
return self._device.color_temp

@property
def min_color_temp_kelvin(self):
"""Return the coldest color_temp that this light supports."""
return COLOR_TEMP_KELVIN_MAX
return COLOR_TEMP_KELVIN_MIN

@property
def max_color_temp_kelvin(self):
"""Return the warmest color_temp that this light supports."""
return COLOR_TEMP_KELVIN_MIN
return COLOR_TEMP_KELVIN_MAX

@property
def extra_state_attributes(self):
Expand Down
8 changes: 4 additions & 4 deletions custom_components/govee/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"domain": "govee",
"name": "Govee",
"codeowners": ["@LaggAt"],
"codeowners": ["@TheOneOgre"],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/LaggAt/hacs-govee/blob/master/README.md",
"documentation": "https://github.com/TheOneOgre/govee-cloud/blob/master/README.md",
"homekit": {},
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/LaggAt/hacs-govee/issues",
"issue_tracker": "https://github.com/TheOneOgre/govee-cloud/issues",
"requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.0"],
"ssdp": [],
"version": "2025.1.1",
"version": "2025.6.1",
"zeroconf": []
}
4 changes: 2 additions & 2 deletions custom_components/govee/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"delay": "Poll Interval"
},
"title": "",
"description": "Get your API Key from the Govee Home App. For Details see https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Get your API Key from the Govee Home App. For Details see https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
},
Expand All @@ -35,7 +35,7 @@
"disable_attribute_updates": "DISABLE state updates. Space to disable. Read the README above!"
},
"title": "Options",
"description": "Configure the Govee integration. For Details see https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Configure the Govee integration. For Details see https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
}
Expand Down
41 changes: 41 additions & 0 deletions custom_components/govee/translations/cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"title": "Govee",
"config": {
"abort": {
"already_configured": "Je povolena pouze jedna konfigurace."
},
"error": {
"cannot_connect": "Nelze se připojit. Je API-Klíč v pořádku a internetové připojení funkční?",
"unknown": "Neznámá chyba."
},
"step": {
"user": {
"data": {
"api_key": "API klíč",
"delay": "Interval obnovy"
},
"description": "API Klíč získáte v Govee Home Aplikaci. Detailní postup najdete zde https://github.com/LaggAt/hacs-govee/blob/master/README.md"
}
}
},
"options": {
"error": {
"cannot_connect": "Nelze se připojit. Je API-Klíč v pořádku a internetové připojení funkční?",
"unknown": "Neznámá chyba.",
"disabled_attribute_updates_wrong": "Špatný formát, přečtěte si README."
},
"step": {
"user": {
"data": {
"api_key": "API klíč (vyžaduje restart)",
"delay": "Interval obnovy (vyžaduje restart)",
"use_assumed_state": "Použít 'předpokládaný stav' (dvě tlačítka). Výchozí: Ano",
"offline_is_off": "Když je světlo offline, zobrazit jako vypnuté (výchozí nezmění stav). Výchozí: Ne",
"disable_attribute_updates": "ZAKÁZAT aktualizace stavu. Přečtěte si README!"
},
"title": "Nastavení",
"description": "Nastavení Govee integrace. Pro více informací jděte na https://github.com/LaggAt/hacs-govee/blob/master/README.md"
}
}
}
}
6 changes: 3 additions & 3 deletions custom_components/govee/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"api_key": "API Key",
"delay": "Abfrage-Intervall"
},
"description": "Den API Key bekommen Sie in der Govee Home App. Details dazu hier: https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Den API Key bekommen Sie in der Govee Home App. Details dazu hier: https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
},
Expand All @@ -34,8 +34,8 @@
"disable_attribute_updates": "Status updates verhindern. Leertaste zum ausschalten. Bitte das README oben dazu lesen."
},
"title": "Einstellungen",
"description": "Einstellen der Govee Integration. Details dazu hier: https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Einstellen der Govee Integration. Details dazu hier: https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
}
}
}
4 changes: 2 additions & 2 deletions custom_components/govee/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"api_key": "API Key",
"delay": "Poll Interval"
},
"description": "Get your API Key from the Govee Home App. For Details see https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Get your API Key from the Govee Home App. For Details see https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
},
Expand All @@ -34,7 +34,7 @@
"disable_attribute_updates": "DISABLE state updates. Space to disable. Read the README above!"
},
"title": "Options",
"description": "Configure the Govee integration. For Details see https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Configure the Govee integration. For Details see https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/govee/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"api_key": "clé d'API",
"delay": "Intervalle d'interrogation"
},
"description": "Obtenez votre clé API à partir de l'application Govee Home. Pour plus de détails, visitez https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Obtenez votre clé API à partir de l'application Govee Home. Pour plus de détails, visitez https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
},
Expand All @@ -34,7 +34,7 @@
"disable_attribute_updates": "DÉSACTIVER les mises à jour d'état. Espace pour désactiver. Lisez le 'lisez-moi' ci-dessus !"
},
"title": "Options",
"description": "Configurez l'intégration Govee. Pour plus de détails, visitez https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Configurez l'intégration Govee. Pour plus de détails, visitez https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/govee/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"api_key": "Chave de API",
"delay": "Intervalo de escaneamento"
},
"description": "Obtenha sua chave de API do aplicativo Govee Home. Para detalhes consulte https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Obtenha sua chave de API do aplicativo Govee Home. Para detalhes consulte https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
},
Expand All @@ -34,7 +34,7 @@
"disable_attribute_updates": "DESATIVAR atualizações de estado. Espaço para desativar. Leia o README acima!"
},
"title": "Opções",
"description": "Configure a integração do Govee. Para detalhes consulte https://github.com/LaggAt/hacs-govee/blob/master/README.md"
"description": "Configure a integração do Govee. Para detalhes consulte https://github.com/TheOneOgre/govee-cloud/blob/master/README.md"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "govee",
"homeassistant": "2023.11.2"
"homeassistant": "2025.6.1"
}
2 changes: 1 addition & 1 deletion tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test the Govee config flow."""
"""Test the Govee config flow"""
from homeassistant import config_entries, setup
from custom_components.govee.const import DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_DELAY
Expand Down
Loading