def __repr__(self): attr = "; {}".format(util.repr_helper(self.attributes)) \ if self.attributes else "" return "<state {}={}{} @ {}>".format( self.entity_id, self.state, attr, dt_util.datetime_to_local_str(self.last_changed))
def busy_callback(worker_count, current_jobs, pending_jobs_count): """ Callback to be called when the pool queue gets too big. """ _LOGGER.warning("WorkerPool:All %d threads are busy and %d jobs pending", worker_count, pending_jobs_count) for start, job in current_jobs: _LOGGER.warning("WorkerPool:Current job from %s: %s", date_util.datetime_to_local_str(start), job)
def busy_callback(worker_count, current_jobs, pending_jobs_count): """Callback to be called when the pool queue gets too big.""" _LOGGER.warning( "WorkerPool:All %d threads are busy and %d jobs pending", worker_count, pending_jobs_count) for start, job in current_jobs: _LOGGER.warning("WorkerPool:Current job from %s: %s", dt_util.datetime_to_local_str(start), job)
def test_datetime_to_local_str(self): """Test datetime_to_local_str.""" self.assertEqual( dt_util.datetime_to_str(dt_util.now()), dt_util.datetime_to_local_str(dt_util.utcnow()))