=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -10,6 +10,7 @@ namespace adas_core.module.LightBeacons.Devices;
|
||||
/// This class represents a light beacon device that can be controlled via HTTP requests. It retrieves the current color of the beacon by parsing HTML pages and sends commands to change the beacon's color.
|
||||
/// The class includes error handling and retry logic for network operations, and it can be configured to emulate the beacon for testing purposes.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=483377a -->
|
||||
public class Turktbens2LightBeacon : LightBeacon
|
||||
{
|
||||
/// <summary>
|
||||
@@ -81,6 +82,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// </summary>
|
||||
/// <param name="options">A dictionary containing the configuration options for the beacon.</param>
|
||||
/// <exception cref="ArgumentException">Thrown when required options are missing or invalid.</exception>
|
||||
/// <!-- aidoc:v1 sig=e320a8e body=1b6dc81 -->
|
||||
public Turktbens2LightBeacon(EquatableDictionary<string, object> options) : base(options)
|
||||
{
|
||||
_logger = Log.ForContext<Turktbens2LightBeacon>();
|
||||
@@ -108,6 +110,10 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// returns OFF when some error appears or try to parse the bits to BalizaColors enum
|
||||
/// </summary>
|
||||
/// <returns>The current color of the beacon as a LightBeaconColor enum value.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "Summary contains leftover template placeholder 'GetByCodeSysAndCode' at the start, which is not meaningful in this context." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "Summary references 'BalizaColors' enum, but the code uses 'LightBeaconColor' (also confirmed by the <returns> tag)." -->
|
||||
public override async Task<LightBeaconColor> GetBeaconColor()
|
||||
{
|
||||
if (_emulate)
|
||||
@@ -194,6 +200,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// If an error occurs, it logs the error message and rethrows the exception to be handled by the caller.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <!-- aidoc:v1 sig=18624ee body=9cbaa1f -->
|
||||
public override async Task BlueCode()
|
||||
{
|
||||
try
|
||||
@@ -211,6 +218,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// The RedCode method sends a command to the beacon's web interface to change the beacon's color to red.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <!-- aidoc:v1 sig=a28d324 body=00b8012 -->
|
||||
public override async Task RedCode()
|
||||
{
|
||||
try
|
||||
@@ -228,6 +236,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// The YellowCode method sends a command to the beacon's web interface to change the beacon's color to yellow.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <!-- aidoc:v1 sig=5e4bc69 body=34c7285 -->
|
||||
public override async Task YellowCode()
|
||||
{
|
||||
try
|
||||
@@ -245,6 +254,10 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// The GreenCode method sends a command to the beacon's web interface to change the beacon's color to green.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "Documentation describes a 'GreenCode' method that changes the beacon's color to green, but the actual method is PowerOffLed that sends an off code." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=mentions_removed_behavior
|
||||
/// "Documentation references a GreenCode behavior (changing color to green) that the code does not implement." -->
|
||||
public override async Task PowerOffLed()
|
||||
{
|
||||
try
|
||||
@@ -264,6 +277,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// <param name="obs">The patient observation based on which the color alert should be generated.</param>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
/// <!-- aidoc:v1 sig=7b58387 body=bfa6f2f -->
|
||||
public override Task GenerateColorAlert(PatientObservation obs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -274,6 +288,7 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// </summary>
|
||||
/// <param name="colorCodes">The color code to be sent to the beacon.</param>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <!-- aidoc:v1 sig=9c8fbe5 body=e3eb8e4 -->
|
||||
private async Task Send(ColorsCodes colorCodes)
|
||||
{
|
||||
var clr = ((int)colorCodes).ToString().PadLeft(3, '0');
|
||||
@@ -306,6 +321,8 @@ public class Turktbens2LightBeacon : LightBeacon
|
||||
/// <param name="body">The body parameters to be sent in the HTTP POST request.</param>
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
/// <exception cref="InvalidOperationException"></exception>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_summary
|
||||
/// "The summary describes the method as 'private' but it is declared as 'protected'." -->
|
||||
protected async Task SendMessage(Dictionary<string, string> body)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_url)) throw new InvalidOperationException("URL is not set.");
|
||||
|
||||
Reference in New Issue
Block a user