Merge pull request #49 from PeteBa/restrictions-check

Revert California Restrictions check
This commit is contained in:
Samer Albahra
2019-05-26 23:12:34 -05:00
committed by GitHub

View File

@@ -221,6 +221,7 @@ export const getWateringData = async function( req: express.Request, res: expres
// parsed. This allows the adjustment method and the restriction type to both // parsed. This allows the adjustment method and the restriction type to both
// be saved in the same byte. // be saved in the same byte.
let adjustmentMethod: number = req.params[ 0 ] & ~( 1 << 7 ), let adjustmentMethod: number = req.params[ 0 ] & ~( 1 << 7 ),
checkRestrictions: boolean = ( ( req.params[ 0 ] >> 7 ) & 1 ) > 0,
adjustmentOptionsString: string = getParameter(req.query.wto), adjustmentOptionsString: string = getParameter(req.query.wto),
location: string | GeoCoordinates = getParameter(req.query.loc), location: string | GeoCoordinates = getParameter(req.query.loc),
outputFormat: string = getParameter(req.query.format), outputFormat: string = getParameter(req.query.format),
@@ -262,7 +263,7 @@ export const getWateringData = async function( req: express.Request, res: expres
let wateringData: WateringData; let wateringData: WateringData;
if ( local.useLocalWeather() ) { if ( local.useLocalWeather() ) {
wateringData = await getLocalWateringData( coordinates ); wateringData = await getLocalWateringData( coordinates );
} else if ( adjustmentMethod !== 0 ) { } else if ( adjustmentMethod !== 0 || checkRestrictions ) {
wateringData = await weatherProvider.getWateringData(coordinates); wateringData = await weatherProvider.getWateringData(coordinates);
} }