Skip to content

Commit

Permalink
Add In One by Legrand Sagane references
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Dec 9, 2024
1 parent bc1aa09 commit 4f679a9
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 86 deletions.
81 changes: 45 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,51 @@ gateways and a higher-level MQTT integration that can be directly used with home

## Supported devices

The following Legrand and BTicino products have been tested and are partially or fully supported by OpenNetty:

| Product series | Design series | Legrand reference | BTicino reference |
|-------------------|---------------|-------------------|-------------------|
| In One by Legrand | Lexic | 03600 | |
| In One by Legrand | Lexic | 03648 | |
| In One by Legrand | Lexic | 03809 | |
| In One by Legrand | | 43214 | |
| In One by Legrand | Céliane | 67201 | |
| In One by Legrand | Céliane | 67202 | |
| In One by Legrand | Céliane | 67203 | |
| In One by Legrand | Céliane | 67204 | |
| In One by Legrand | Céliane | 67208 | |
| In One by Legrand | Céliane | 67210 | |
| In One by Legrand | Céliane | 67212 | |
| In One by Legrand | Céliane | 67214 | |
| In One by Legrand | Céliane | 67215 | |
| In One by Legrand | Céliane | 67220 | |
| In One by Legrand | Céliane | 67222 | |
| In One by Legrand | Céliane | 67280 | |
| In One by Legrand | Céliane | 67290 | |
| In One by Legrand | Céliane | 67445 | |
| In One by Legrand | Céliane | 67448 | |
| In One by Legrand | Plexo | 69510 | |
| In One by Legrand | | 88205 | |
| In One by Legrand | | 88213 | |
| | | | |
| MyHome Up | | 03847 | F411U1 |
| MyHome Up | | 03848 | F411U2 |
| MyHome Up | | 03651 | F418U2 |
| MyHome Up | | 03598 | F454 |
| MyHome Up | | 03535 | MH202 |
| | | | |
| MyHome Play | Céliane | 67223 | |
| MyHome Play | | 88328 | 3578 |
| MyHome Play | | 88337 | |
The following Legrand and BTicino products are partially or fully supported by OpenNetty:

| Product series | Product collection | Legrand reference | BTicino reference |
|-------------------|--------------------|-------------------|-------------------|
| In One by Legrand | Lexic | 03600 | |
| In One by Legrand | Lexic | 03648 | |
| In One by Legrand | Lexic | 03809 | |
| In One by Legrand | | 43214 | |
| In One by Legrand | Céliane | 67201 | |
| In One by Legrand | Céliane | 67202 | |
| In One by Legrand | Céliane | 67203 | |
| In One by Legrand | Céliane | 67204 | |
| In One by Legrand | Céliane | 67208 | |
| In One by Legrand | Céliane | 67210 | |
| In One by Legrand | Céliane | 67212 | |
| In One by Legrand | Céliane | 67214 | |
| In One by Legrand | Céliane | 67215 | |
| In One by Legrand | Céliane | 67220 | |
| In One by Legrand | Céliane | 67222 | |
| In One by Legrand | Céliane | 67280 | |
| In One by Legrand | Céliane | 67290 | |
| In One by Legrand | Céliane | 67445 | |
| In One by Legrand | Céliane | 67448 | |
| In One by Legrand | Plexo | 69510 | |
| In One by Legrand | Sagane | 84520 | |
| In One by Legrand | Sagane | 84522 | |
| In One by Legrand | Sagane | 84523 | |
| In One by Legrand | Sagane | 84524 | |
| In One by Legrand | Sagane | 84525 | |
| In One by Legrand | Sagane | 84529 | |
| In One by Legrand | Sagane | 84530 | |
| In One by Legrand | Sagane | 84531 | |
| In One by Legrand | Sagane | 84542 | |
| In One by Legrand | | 88205 | |
| In One by Legrand | | 88213 | |
| | | | |
| MyHome Up | | 03847 | F411U1 |
| MyHome Up | | 03848 | F411U2 |
| MyHome Up | | 03651 | F418U2 |
| MyHome Up | | 03598 | F454 |
| MyHome Up | | 03535 | MH202 |
| | | | |
| MyHome Play | Céliane | 67223 | |
| MyHome Play | | 88328 | 3578 |
| MyHome Play | | 88337 | |

> [!NOTE]
> Support for additional devices will be progressively added depending on the demand.
Expand Down
8 changes: 7 additions & 1 deletion src/OpenNetty/OpenNettyDeviceDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

using System.Collections.Immutable;
using System.Reactive;

namespace OpenNetty;

Expand Down Expand Up @@ -34,6 +33,11 @@ public sealed class OpenNettyDeviceDefinition : IEquatable<OpenNettyDeviceDefini
/// </summary>
public required OpenNettyProtocol Protocol { get; init; }

/// <summary>
/// Gets or sets the series associated with the device definition.
/// </summary>
public required string Series { get; init; }

/// <summary>
/// Gets or sets the OpenNetty-defined settings associated with the device definition.
/// </summary>
Expand All @@ -58,6 +62,7 @@ public bool Equals(OpenNettyDeviceDefinition? other)
Identities.Length == other.Identities.Length && !Identities.Except(other.Identities).Any() &&
Media == other.Media &&
Protocol == other.Protocol &&
string.Equals(Series, other.Series, StringComparison.OrdinalIgnoreCase) &&
Settings.Count == other.Settings.Count && !Settings.Except(other.Settings).Any() &&
Units.Length == other.Units.Length && !Units.Except(other.Units).Any();
}
Expand All @@ -84,6 +89,7 @@ public override int GetHashCode()

hash.Add(Media);
hash.Add(Protocol);
hash.Add(Series);

hash.Add(Settings.Count);
foreach (var (name, value) in Settings)
Expand Down
4 changes: 3 additions & 1 deletion src/OpenNetty/OpenNettyDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static class OpenNettyDevices

if (!Enum.IsDefined(brand))
{
throw new ArgumentException(SR.GetResourceString(SR.ID0005), nameof(brand));
throw new ArgumentException(SR.GetResourceString(SR.ID0006), nameof(brand));
}

using var stream = Assembly.GetAssembly(typeof(OpenNettyDevices))?.GetManifestResourceStream(
Expand Down Expand Up @@ -135,6 +135,7 @@ private static OpenNettyDeviceDefinition CreateDeviceDefinition(XElement node)
identities.Add(new OpenNettyIdentity
{
Brand = Enum.Parse<OpenNettyBrand>((string) identity.Attribute("Brand")!),
Collection = (string?) identity.Attribute("Collection"),
Model = (string) identity.Attribute("Model")!
});
}
Expand All @@ -155,6 +156,7 @@ private static OpenNettyDeviceDefinition CreateDeviceDefinition(XElement node)
Identities = [.. identities],
Media = Enum.Parse<OpenNettyMedia>((string) node.Attribute("Media")!),
Protocol = Enum.Parse<OpenNettyProtocol>((string) node.Attribute("Protocol")!),
Series = (string) node.Attribute("Series")!,
Settings = settings.ToImmutableDictionary(),
Units = [.. units]
};
Expand Down
Loading

0 comments on commit 4f679a9

Please sign in to comment.