Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to utc time #32

Merged
merged 2 commits into from
May 19, 2024
Merged
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
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 }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,6 @@ OTA/*
/DbMigrator/history.db-wal
/AppBrokerASP/JSDevices
/AppBrokerASP/JSExtensionDevices
*.dll
*.old
/DbMigrator/old
24 changes: 12 additions & 12 deletions AppBroker.Core/AppBroker.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
Expand All @@ -16,20 +16,20 @@

<ItemGroup>

<PackageReference Include="CoordinateSharp" Version="2.15.2.1" />
<PackageReference Include="CoordinateSharp" Version="2.22.1.1" />

<PackageReference Include="Jint" Version="3.0.0-beta-2041" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.0" />
<PackageReference Include="NonSucking.Framework.Extension" Version="0.1.0.74-alpha" />
<PackageReference Include="Jint" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageReference Include="NonSucking.Framework.Extension" Version="1.0.0" />
<PackageReference Include="NonSucking.Framework.Extension.EntityFrameworkCore" Version="0.1.0.107-alpha" />
<PackageReference Include="NonSucking.Framework.Serialization" Version="0.1.0.66-alpha" />
<PackageReference Include="Quartz" Version="3.5.0" />
<PackageReference Include="NonSucking.Framework.Serialization" Version="1.0.0" />
<PackageReference Include="Quartz" Version="3.9.0" />
<PackageReference Include="System.Runtime.Experimental" Version="6.0.2" />
<PackageReference Include="NiL.JS" Version="2.5.1600" />
<PackageReference Include="NiL.JS" Version="2.5.1677" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 1 addition & 10 deletions AppBroker.Core/Devices/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.Json;

namespace AppBroker.Core.Devices;

Expand Down Expand Up @@ -152,16 +153,6 @@ var oldConfs

public virtual dynamic? GetConfig()
{
using BrokerDbContext? cont = DbProvider.BrokerDbContext;
var configs = cont
.HeaterConfigs
.Where(x => x.DeviceId == Id)
.ToList()
.Select<HeaterConfigModel, HeaterConfig>(x => x)
.ToList();
if (configs.Count > 0)
return configs.ToJson();

return null;
}

Expand Down
3 changes: 2 additions & 1 deletion AppBroker.Core/DynamicUI/DeviceLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public record DeviceLayout(
long[]? Ids,
DashboardDeviceLayout? DashboardDeviceLayout,
DetailDeviceLayout? DetailDeviceLayout,
[property:Newtonsoft.Json.JsonExtensionData]IDictionary<string, string> AdditionalData,
int Version = 1,
bool ShowOnlyInDeveloperMode = false);
bool ShowOnlyInDeveloperMode = false );
4 changes: 1 addition & 3 deletions AppBroker.Core/Models/HeaterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public static implicit operator TimeTempMessageLE(HeaterConfig hc)
=> new(hc.DayOfWeek, new TimeSpan(hc.TimeOfDay.Hour, hc.TimeOfDay.Minute, 0), (float)hc.Temperature);
public static implicit operator HeaterConfig(TimeTempMessageLE ttm)
{
var dt = DateTime.Now;
dt = dt.AddHours(ttm.Time.Hours - dt.Hour);
dt = dt.AddMinutes(ttm.Time.Minutes - dt.Minute);
var dt = new DateTime(2000, 01, 01, ttm.Time.Hours, ttm.Time.Minutes, ttm.Time.Seconds, DateTimeKind.Utc);
return new HeaterConfig(ttm.DayOfWeek, dt, ttm.Temp);
}

Expand Down
2 changes: 2 additions & 0 deletions AppBroker.Core/Models/History.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace AppBroker.Core.Models;

public class History
{
public static History Empty => new History();

public History(HistoryRecord[] historyRecords, string propertyName)
{
HistoryRecords = historyRecords;
Expand Down
26 changes: 13 additions & 13 deletions AppBroker.Elsa/AppBroker.Elsa.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
Expand All @@ -18,18 +18,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Elsa.Abstractions" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Conductor" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Console" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Email" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.File" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Http" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Temporal.Common" Version="2.9.2" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" Version="2.9.2" />
<PackageReference Include="Elsa.Persistence.EntityFramework.Sqlite" Version="2.9.2" />
<PackageReference Include="Elsa.Scripting.JavaScript" Version="2.9.2" />
<PackageReference Include="Elsa.Scripting.Liquid" Version="2.9.2" />
<PackageReference Include="Elsa" Version="2.9.2" />
<PackageReference Include="Elsa.Abstractions" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Conductor" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Console" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Email" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.File" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Http" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Temporal.Common" Version="2.14.1" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" Version="2.14.1" />
<PackageReference Include="Elsa.Persistence.EntityFramework.Sqlite" Version="2.14.1" />
<PackageReference Include="Elsa.Scripting.JavaScript" Version="2.14.1" />
<PackageReference Include="Elsa.Scripting.Liquid" Version="2.14.1" />
<PackageReference Include="Elsa" Version="3.1.3" />
<PackageReference Include="System.Runtime.Experimental" Version="6.0.2" />
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions AppBroker.Generators.Test/AppBroker.Generators.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
Expand All @@ -16,14 +16,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
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.4.0" 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>net7.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))
{
}
}
Loading
Loading