Exemple #1
0
    def get_current(self, force=False):
        current = self.current
        indicator = self.get_indicator().lower()

        if 'f' == indicator:
            current = terrariumUtils.to_fahrenheit(self.current)
        elif 'inch' == indicator:
            current = terrariumUtils.to_inches(self.current)

        return float(current)
Exemple #2
0
    def get_current(self, force=False):
        current = 0 if self.current is None else self.current
        indicator = self.get_indicator().lower()

        if 'f' == indicator:
            current = terrariumUtils.to_fahrenheit(current)
        elif 'k' == indicator:
            current = terrariumUtils.to_kelvin(current)
        elif 'inch' == indicator:
            current = terrariumUtils.to_inches(current)
        elif 'usgall' == indicator:
            current = terrariumUtils.to_us_gallons(current)
        elif 'ukgall' == indicator:
            current = terrariumUtils.to_uk_gallons(current)

        return float(current)
Exemple #3
0
    def get_current(self, force=False):
        if self.__current_value is None:
            return None

        indicator = self.get_indicator().lower()

        if 'f' == indicator:
            current = terrariumUtils.to_fahrenheit(self.__current_value)
        elif 'k' == indicator:
            current = terrariumUtils.to_kelvin(self.__current_value)
        elif 'inch' == indicator:
            current = terrariumUtils.to_inches(self.__current_value)
        elif 'usgall' == indicator:
            current = terrariumUtils.to_us_gallons(self.__current_value)
        elif 'ukgall' == indicator:
            current = terrariumUtils.to_uk_gallons(self.__current_value)

        return float(self.__current_value)