Skip to content

Commit

Permalink
Moved SocketIO into io broker plugin
Browse files Browse the repository at this point in the history
* since it is only used by this plugin and shouldn't be in the main app broker project
* fixed SocketIO now beeing also a namepsace, so having to fully qualify the SocketIO name
* fixed errors that happened during master rebase
  • Loading branch information
susch19 committed May 19, 2024
1 parent b69c679 commit 8b45324
Show file tree
Hide file tree
Showing 47 changed files with 137 additions and 344 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,42 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'amd64,arm,arm64'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Get Git Submodules
run: git submodule update --init --recursive

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.REPO_NAME }}
- name: Build AppBroker and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
file: AppBrokerASP/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/susch19/appbroker:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Build TCPProxy and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
file: TcpProxy/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/susch19/appbroker-tcpproxy:latest
labels: ${{ steps.meta.outputs.labels }}
# - name: Build TCPProxy and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
# file: TcpProxy/Dockerfile
# push: true
# tags: ghcr.io/susch19/appbroker-tcpproxy:${{ github.event.inputs.tag }}
# labels: ${{ steps.meta.outputs.labels }}

32 changes: 14 additions & 18 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,43 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'amd64,arm,arm64'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Get Git Submodules
run: git submodule update --init --recursive

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.REPO_NAME }}
- name: Build AppBroker and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
file: AppBrokerASP/Dockerfile
push: true
tags: ghcr.io/susch19/appbroker:${{ github.event.inputs.tag }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build TCPProxy and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
file: TcpProxy/Dockerfile
push: true
tags: ghcr.io/susch19/appbroker-tcpproxy:${{ github.event.inputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Build TCPProxy and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
# file: TcpProxy/Dockerfile
# push: true
# tags: ghcr.io/susch19/appbroker-tcpproxy:${{ github.event.inputs.tag }}
# labels: ${{ steps.meta.outputs.labels }}

1 change: 0 additions & 1 deletion AppBroker.Generators/AppBroker.Generators.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" GeneratePathProperty="true" />
<None Include="$(PkgMicrosoft_CodeAnalysis_CSharp)\lib\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
Expand Down
30 changes: 20 additions & 10 deletions AppBroker.IOBroker/AppBroker.IOBroker.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AppBrokerASP\AppBrokerASP.csproj" />
<ProjectReference Include="..\AppBroker.Generators\AppBroker.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Activities\**" />
<EmbeddedResource Remove="Activities\**" />
<None Remove="Activities\**" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AppBrokerASP\AppBrokerASP.csproj" />
<ProjectReference Include="..\AppBroker.Generators\AppBroker.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SocketIOClient" Version="3.1.1" />

</ItemGroup>

<Target Name="CopyDLLs" AfterTargets="Build">
<ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/Dummy.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("SPZB0001")]
public class Dummy : UpdateableZigbeeDevice
{
public Dummy(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(Dummy))
public Dummy(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(Dummy))
{
}
}
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/FloaltPanel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("FLOALT panel WS 60x60", "L1529", "T2011")]
public class FloaltPanel : ZigbeeLamp
{
public FloaltPanel(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(FloaltPanel))
public FloaltPanel(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(FloaltPanel))
{
}

Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/LumiRouter.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("lumi.router")]
public class LumiRouter : ZigbeeDevice
{
public LumiRouter(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(LumiRouter))
public LumiRouter(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(LumiRouter))
{
ShowInApp = false;
}
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/OsramB40RW.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("Classic B40 TW - LIGHTIFY", "AB32840")]
public class OsramB40RW : ZigbeeLamp
{
public OsramB40RW(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(OsramB40RW))
public OsramB40RW(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(OsramB40RW))
{
}
}
3 changes: 1 addition & 2 deletions AppBroker.IOBroker/Devices/OsramPlug.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("Plug 01", "AB3257001NJ")]
public class OsramPlug : ZigbeeSwitch
{
public OsramPlug(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(OsramPlug))
public OsramPlug(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(OsramPlug))
{
ShowInApp = true;
}
Expand Down
6 changes: 2 additions & 4 deletions AppBroker.IOBroker/Devices/OsvallaPanel.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using SocketIOClient;

namespace AppBroker.IOBroker.Devices;
namespace AppBroker.IOBroker.Devices;

//[DeviceName("T2011")]
public class OsvallaPanel : ZigbeeLamp
{
public OsvallaPanel(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(OsvallaPanel))
public OsvallaPanel(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(OsvallaPanel))
{
}
}
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/TradfriControlOutlet.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("E1603/E1702")]
public class TradfriControlOutlet : ZigbeeSwitch
{
public TradfriControlOutlet(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(TradfriControlOutlet))
public TradfriControlOutlet(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(TradfriControlOutlet))
{
}
}
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/TradfriLedBulb.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("TRADFRI bulb E27 CWS opal 600lm", "TRADFRI bulb E14 CWS opal 600lm", "LED1624G9")]
public partial class TradfriLedBulb : ZigbeeLamp
{
public TradfriLedBulb(long nodeId, SocketIO socket) :
public TradfriLedBulb(long nodeId, SocketIOClient.SocketIO socket) :
base(nodeId, socket, nameof(TradfriLedBulb))
{
ShowInApp = true;
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/TradfriMotionSensor.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("E1525/E1745")]
public partial class TradfriMotionSensor : ZigbeeDevice
{

public TradfriMotionSensor(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(TradfriMotionSensor))
public TradfriMotionSensor(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(TradfriMotionSensor))
{
ShowInApp = true;
}
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/TradfriRemoteControl.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("TRADFRI remote control", "E1524/E1810")]
public class TradfriRemoteControl : ZigbeeDevice
{
public TradfriRemoteControl(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(TradfriRemoteControl))
public TradfriRemoteControl(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(TradfriRemoteControl))
{
ShowInApp = false;
}
Expand Down
5 changes: 2 additions & 3 deletions AppBroker.IOBroker/Devices/TuyaSwitchSensor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SocketIOClient;
using AppBroker.Core.Models;
using AppBroker.Core.Models;
using AppBroker.Core.Devices;

namespace AppBroker.IOBroker.Devices;
Expand All @@ -8,7 +7,7 @@ namespace AppBroker.IOBroker.Devices;
public partial class TuyaSwitchSensor : ZigbeeSwitch
{

public TuyaSwitchSensor(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(TuyaSwitchSensor))
public TuyaSwitchSensor(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(TuyaSwitchSensor))
{
ShowInApp = true;
}
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/UpdateableZigbeeDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

using NiL.JS.Core;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

public class UpdateableZigbeeDevice : ZigbeeDevice
{
public UpdateableZigbeeDevice(long nodeId, SocketIO socket, string typeName) :
public UpdateableZigbeeDevice(long nodeId, SocketIOClient.SocketIO socket, string typeName) :
base(nodeId, socket, typeName)
{

Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/XiaomiTempSensor.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("lumi.weather", "WSDCGQ11LM")]

public partial class XiaomiTempSensor : ZigbeeDevice
{

public XiaomiTempSensor(long id, SocketIO socket) : base(id, socket, nameof(XiaomiTempSensor))
public XiaomiTempSensor(long id, SocketIOClient.SocketIO socket) : base(id, socket, nameof(XiaomiTempSensor))
{
ShowInApp = true;
}
Expand Down
4 changes: 1 addition & 3 deletions AppBroker.IOBroker/Devices/ZigbeeContactSensor.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using AppBroker.Core.Devices;

using SocketIOClient;

namespace AppBroker.IOBroker.Devices;

[DeviceName("MCCGQ11LM")]

public partial class ZigbeeContactSensor : ZigbeeDevice
{
public ZigbeeContactSensor(long nodeId, SocketIO socket) : base(nodeId, socket, nameof(ZigbeeContactSensor))
public ZigbeeContactSensor(long nodeId, SocketIOClient.SocketIO socket) : base(nodeId, socket, nameof(ZigbeeContactSensor))
{
ShowInApp = true;
}
Expand Down
Loading

0 comments on commit 8b45324

Please sign in to comment.