mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Added a case for the Zero 2 W.
This commit is contained in:
parent
f5066c541f
commit
9f00c2fb8a
BIN
case/Z2/LPM_Case_Z2_Base.blend
Normal file
BIN
case/Z2/LPM_Case_Z2_Base.blend
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Base.stl
Normal file
BIN
case/Z2/LPM_Case_Z2_Base.stl
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Base_Flange.blend
Normal file
BIN
case/Z2/LPM_Case_Z2_Base_Flange.blend
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Base_Flange.stl
Normal file
BIN
case/Z2/LPM_Case_Z2_Base_Flange.stl
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Lid.blend
Normal file
BIN
case/Z2/LPM_Case_Z2_Lid.blend
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Lid.stl
Normal file
BIN
case/Z2/LPM_Case_Z2_Lid.stl
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Middle.blend
Normal file
BIN
case/Z2/LPM_Case_Z2_Middle.blend
Normal file
Binary file not shown.
BIN
case/Z2/LPM_Case_Z2_Middle.stl
Normal file
BIN
case/Z2/LPM_Case_Z2_Middle.stl
Normal file
Binary file not shown.
BIN
case/Z2/Z2_GPIO_Lid.blend
Normal file
BIN
case/Z2/Z2_GPIO_Lid.blend
Normal file
Binary file not shown.
BIN
case/Z2/Z2_GPIO_Lid.stl
Normal file
BIN
case/Z2/Z2_GPIO_Lid.stl
Normal file
Binary file not shown.
|
@ -302,6 +302,8 @@ public class MongoCurrentMonitorDao implements CurrentMonitorDao {
|
||||||
@Override
|
@Override
|
||||||
public void rebuildSummaries(int _accountId, Date _start, Date _end) {
|
public void rebuildSummaries(int _accountId, Date _start, Date _end) {
|
||||||
BreakerConfig config = getConfig(_accountId);
|
BreakerConfig config = getConfig(_accountId);
|
||||||
|
if (config == null)
|
||||||
|
return;
|
||||||
TimeZone tz = getTimeZoneForAccount(_accountId);
|
TimeZone tz = getTimeZoneForAccount(_accountId);
|
||||||
Date start = DateUtils.getMidnightBefore(_start, tz);
|
Date start = DateUtils.getMidnightBefore(_start, tz);
|
||||||
BreakerGroup root = CollectionUtils.getFirst(config.getBreakerGroups());
|
BreakerGroup root = CollectionUtils.getFirst(config.getBreakerGroups());
|
||||||
|
@ -397,8 +399,14 @@ public class MongoCurrentMonitorDao implements CurrentMonitorDao {
|
||||||
public BreakerConfig getMergedConfig(AuthCode _authCode) {
|
public BreakerConfig getMergedConfig(AuthCode _authCode) {
|
||||||
if (_authCode == null)
|
if (_authCode == null)
|
||||||
return null;
|
return null;
|
||||||
if (CollectionUtils.size(_authCode.getAllAccountIds()) == 1)
|
if (CollectionUtils.size(_authCode.getAllAccountIds()) == 1) {
|
||||||
return getConfig(_authCode.getAccountId());
|
BreakerConfig config = getConfig(_authCode.getAccountId());
|
||||||
|
if (config == null) {
|
||||||
|
config = new BreakerConfig();
|
||||||
|
config.setAccountId(_authCode.getAccountId());
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
}
|
||||||
List<BreakerConfig> configs = CollectionUtils.transform(_authCode.getAllAccountIds(), this::getConfig, true);
|
List<BreakerConfig> configs = CollectionUtils.transform(_authCode.getAllAccountIds(), this::getConfig, true);
|
||||||
BreakerConfig config = new BreakerConfig();
|
BreakerConfig config = new BreakerConfig();
|
||||||
config.setAccountId(_authCode.getAccountId());
|
config.setAccountId(_authCode.getAccountId());
|
||||||
|
@ -438,7 +446,9 @@ public class MongoCurrentMonitorDao implements CurrentMonitorDao {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String authenticateAccount(String _username, String _password) {
|
public String authenticateAccount(String _username, String _password) {
|
||||||
Account acct = proxy.queryOne(Account.class, new DaoQuery("username", _username));
|
if (NullUtils.isEmpty(_username) || NullUtils.isEmpty(_password))
|
||||||
|
return null;
|
||||||
|
Account acct = proxy.queryOne(Account.class, new DaoQuery("username", _username.toLowerCase().trim()));
|
||||||
if ((acct == null) || !BCrypt.checkpw(_password, acct.getPassword()))
|
if ((acct == null) || !BCrypt.checkpw(_password, acct.getPassword()))
|
||||||
return null;
|
return null;
|
||||||
return toAuthCode(acct.getId(), acct.getAuxiliaryAccountIds());
|
return toAuthCode(acct.getId(), acct.getAuxiliaryAccountIds());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user