From 047b7eaacc080ed5a841e3cbb023bb27d12d4a56 Mon Sep 17 00:00:00 2001 From: Markus Kirberg Date: Fri, 18 Oct 2024 14:06:25 +0000 Subject: [PATCH] Fix devcontainer --- .devcontainer/Dockerfile | 6 ++--- .devcontainer/devcontainer.json | 42 ++++++++++++++++----------------- AUTHORS.md | 1 + src/shelly_main.cpp | 30 +++++++++++------------ src/shelly_output.cpp | 2 ++ 5 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b7f664fb..b89a5d2e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,10 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/ubuntu/.devcontainer/base.Dockerfile # [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic -ARG VARIANT="hirsute" -FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} +ARG VARIANT="22.04" +FROM mcr.microsoft.com/devcontainers/base:ubuntu-${VARIANT} # [Optional] Uncomment this section to install additional OS packages. RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends clang-format make software-properties-common -RUN add-apt-repository ppa:mongoose-os/mos && apt-get update && apt-get -y install mos +RUN add-apt-repository ppa:mongoose-os/mos && apt-get update && apt-get -y install mos-latest libavahi-client3 avahi-daemon clang diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a8879970..83ff6d1c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,40 +1,38 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/ubuntu { "name": "Ubuntu", "build": { "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic - // Use hirsute or bionic on local arm64/Apple Silicon. - "args": { "VARIANT": "focal" } + "args": { + "VARIANT": "22.04" + } }, - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "zsh" + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.shell.linux": "zsh" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [], + "tasks": [ + { + "label": "Fileserver", + "type": "shell", + "command": "make build", + "problemMatcher": [] + } + ] + } }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [], - // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "uname -a", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "features": { "docker-in-docker": "20.10", "git": "latest" }, - "tasks": [ - { - "label": "Fileserver", - "type": "shell", - "command": "make build", - "problemMatcher": [] - } - ] + "postStartCommand": "sudo service dbus start; sudo service avahi-daemon start" } \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index 72138c0b..c5cab659 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -9,5 +9,6 @@ The following people have contributed to the project (in chronological order): * [Timothy Langer](https://github.com/ZeeVox) * [Timo Schilling](https://github.com/timoschilling) * [Josef Blösl](https://github.com/jobl1978) + * [Markus Kirberg](https://github.com/markirb) Full list of contributors [here](https://github.com/mongoose-os-apps/shelly-homekit/graphs/contributors). diff --git a/src/shelly_main.cpp b/src/shelly_main.cpp index 717fb1df..79534c57 100644 --- a/src/shelly_main.cpp +++ b/src/shelly_main.cpp @@ -761,28 +761,28 @@ void InitApp() { // Initialize accessory server. HAPAccessoryServerOptions server_options = { - .maxPairings = kHAPPairingStorage_MinElements, + .maxPairings = kHAPPairingStorage_MinElements, #if HAP_IP - .ip = - { - .transport = &kHAPAccessoryServerTransport_IP, + .ip = + { + .transport = &kHAPAccessoryServerTransport_IP, #ifndef __clang__ - .available = 0, + .available = 0, #endif - .accessoryServerStorage = &s_ip_storage, - }, + .accessoryServerStorage = &s_ip_storage, + }, #endif #if HAP_BLE - .ble = - { - .transport = nullptr, + .ble = + { + .transport = nullptr, #ifndef __clang__ - .available = 0, + .available = 0, #endif - .accessoryServerStorage = nullptr, - .preferredAdvertisingInterval = 0, - .preferredNotificationDuration = 0, - }, + .accessoryServerStorage = nullptr, + .preferredAdvertisingInterval = 0, + .preferredNotificationDuration = 0, + }, #endif }; static struct HAPPlatformMFiTokenAuth s_mfi_auth; diff --git a/src/shelly_output.cpp b/src/shelly_output.cpp index a5c42e6b..d2e6cefb 100644 --- a/src/shelly_output.cpp +++ b/src/shelly_output.cpp @@ -83,6 +83,8 @@ Status OutputPin::SetStatePWM(float duty, const char *source) { } return Status::OK(); #else + (void) duty; + (void) source; return Status::UNIMPLEMENTED(); #endif }