68d92c31966dd344a16e9f50dbb28f8ba189bf99,homeassistant/components/sensor/time_date.py,TimeDateSensor,update,#TimeDateSensor#,70

Before Change


    def update(self):
        Get the latest data and updates the states.
        time_date = dt_util.utcnow()
        time = dt_util.datetime_to_time_str(dt_util.as_local(time_date))
        time_utc = dt_util.datetime_to_time_str(time_date)
        date = dt_util.datetime_to_date_str(dt_util.as_local(time_date))

        // Calculate the beat (Swatch Internet Time) time without date.
        hours, minutes, seconds = time_date.strftime("%H:%M:%S").split(":")
        beat = ((int(seconds) + (int(minutes) * 60) + ((int(hours) + 1) *
                                                       3600)) / 86.4)

        if self.type == "time":
            self._state = time
        elif self.type == "date":
            self._state = date
        elif self.type == "date_time":

After Change


    def update(self):
        Get the latest data and updates the states.
        time_date = dt_util.utcnow()
        time = dt_util.as_local(time_date).strftime(TIME_STR_FORMAT)
        time_utc = time_date.strftime(TIME_STR_FORMAT)
        date = dt_util.as_local(time_date).date().isoformat()

        // Calculate the beat (Swatch Internet Time) time without date.
        hours, minutes, seconds = time_date.strftime("%H:%M:%S").split(":")
        beat = ((int(seconds) + (int(minutes) * 60) + ((int(hours) + 1) *
                                                       3600)) / 86.4)

        if self.type == "time":
            self._state = time
        elif self.type == "date":
            self._state = date
        elif self.type == "date_time":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: 68d92c31966dd344a16e9f50dbb28f8ba189bf99
Time: 2016-04-16
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sensor/time_date.py
Class Name: TimeDateSensor
Method Name: update


Project Name: home-assistant/home-assistant
Commit Name: 68d92c31966dd344a16e9f50dbb28f8ba189bf99
Time: 2016-04-16
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sensor/swiss_public_transport.py
Class Name: PublicTransportData
Method Name: update


Project Name: home-assistant/home-assistant
Commit Name: c0cf29aba935fe11f2e537c8301df2c660d118f2
Time: 2018-11-23
Author: paulus@home-assistant.io
File Name: homeassistant/components/sensor/systemmonitor.py
Class Name: SystemMonitorSensor
Method Name: update


Project Name: home-assistant/home-assistant
Commit Name: 68d92c31966dd344a16e9f50dbb28f8ba189bf99
Time: 2016-04-16
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sensor/systemmonitor.py
Class Name: SystemMonitorSensor
Method Name: update