diff --git a/custom_components/hubitat/light.py b/custom_components/hubitat/light.py index 4e5ea05..045eeb5 100644 --- a/custom_components/hubitat/light.py +++ b/custom_components/hubitat/light.py @@ -240,7 +240,15 @@ async def async_turn_on(self, **kwargs: Any) -> None: await self.send_command(CMD_ON) if "hue" in props: - arg = json.dumps({"hue": props["hue"], "saturation": props["sat"]}) + data = { + "hue": props["hue"], + "saturation": props["sat"], + } + level = self.get_int_attr(HE_ATTR_LEVEL) + if isinstance(level, int): + data["level"] = level + + arg = json.dumps(data) await self.send_command(CMD_SET_COLOR, arg) del props["hue"] del props["sat"] diff --git a/custom_components/hubitat/manifest.json b/custom_components/hubitat/manifest.json index f62f90d..eee6fdd 100644 --- a/custom_components/hubitat/manifest.json +++ b/custom_components/hubitat/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.8.1", + "version": "0.8.2b1", "domain": "hubitat", "name": "Hubitat", "config_flow": true, diff --git a/pyproject.toml b/pyproject.toml index ea5203c..2c6240c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hubitat" -version = "0.8.1" +version = "0.8.2b1" description = "A Hubitat integration for Home Assistant" authors = [ {name = "Jason Cheatham", email = "jason@jasoncheatham.com"}, @@ -15,7 +15,8 @@ homepage = "https://github.com/jason0x43/hacs-hubitat" [project.optional-dependencies] [tool.pdm.scripts] init = {shell = "pdm install && pre-commit install"} -test = {shell = "pyright custom_components/hubitat && pytest tests"} +# test = {shell = "pyright custom_components/hubitat && pytest tests"} +test = {shell = "pytest tests"} [tool.pytest.ini_options] testpaths = ["tests"]