Skip to content

Commit

Permalink
Fix dev container setupe
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierarsenault committed Apr 7, 2024
1 parent 3986aaa commit 3bbb171
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"charliermarsh.ruff",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"ms-vscode.live-server"
],
"settings": {
"[python]": {
Expand Down
12 changes: 9 additions & 3 deletions custom_components/moonraker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import PERCENTAGE, UnitOfLength, UnitOfPressure, UnitOfTemperature, UnitOfTime
from homeassistant.const import (
PERCENTAGE,
UnitOfLength,
UnitOfPressure,
UnitOfTemperature,
UnitOfTime,
)
from homeassistant.core import callback

from .const import OBJ, DOMAIN, METHODS, PRINTERSTATES, PRINTSTATES
Expand Down Expand Up @@ -339,7 +345,8 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities):
desc = MoonrakerSensorDescription(
key=f"{split_obj[0]}_{split_obj[1]}",
status_key=obj,
name=split_obj[1].removesuffix("_temp").replace("_", " ").title() + " Temp",
name=split_obj[1].removesuffix("_temp").replace("_", " ").title()
+ " Temp",
value_fn=lambda sensor: sensor.coordinator.data["status"][
sensor.status_key
]["temperature"],
Expand Down Expand Up @@ -401,7 +408,6 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities):
)
sensors.append(desc)


elif split_obj[0] in fan_keys:
desc = MoonrakerSensorDescription(
key=f"{split_obj[0]}_{split_obj[1]}",
Expand Down
2 changes: 0 additions & 2 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ sudo apt-get install -y libturbojpeg0 ffmpeg

python3 -m pip install --requirement requirements.txt

# https://github.com/home-assistant/core/issues/95192
pip install git+https://github.com/boto/botocore

pre-commit install

0 comments on commit 3bbb171

Please sign in to comment.