GenesisMeter: - BUGFIX: Offline Password Handling

This commit is contained in:
Thomas Wiedebusch 2025-10-21 13:22:45 +02:00
parent fa45156233
commit 7f07629512
3 changed files with 13 additions and 4 deletions

View File

@ -63,6 +63,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCBID/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=perc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=PERIODICLOG/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=POWEMON/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=POWERMON/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Preadjustment/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=prot/@EntryIndexedValue">True</s:Boolean>

View File

@ -1224,6 +1224,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
/// <remarks date="2025-Oct-10" author="T.Wiedebusch">
/// - Optional the offline passwords will be used.
/// </remarks>
/// <remarks date="2025-Oct-21" author="T.Wiedebusch">
/// - BUGFIX: Avoid request of password from DB if offline password usage fored.
/// </remarks>
private String GetPassword()
{
// without PCB ID it is not possible to login,
@ -1241,8 +1244,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
}
}
// on unknown password try to get it from DB
if (MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out var password) && !UseOfflinePasswords)
var password = "";
// if NOT offline password usage required try to get it from DB
if (!UseOfflinePasswords && MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out password) )
{
Logger.Info($"Slot:{Slot} - Got password from GenesisPasswordService, " +
$"URL({ServiceUrls.GenesisGetPasswordServiceUrl() + PcbId})");
@ -1266,9 +1270,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
if (!string.IsNullOrEmpty(password))
{
Logger.Info($"Slot:{Slot} - Got password for PcbId:{PcbId} from password file!");
Logger.Info($"Slot:{Slot} - Got password for PcbId:{PcbId} from 'offline password' file!");
OfflinePassword = password;
}
else
{
Logger.Info($"Slot:{Slot} - 'offline password' file does not contain a password for PcbId:{PcbId} !");
}
}
return password;

@ -1 +1 @@
Subproject commit 41c1163d102dbb63572e60c6ffd501e1765d848c
Subproject commit a9ef9051cabb74806a4ce0293794cf95756883e6