Traceback (most recent call last):


 "/usr/src/app/homeassistant/components/hue/sensor_base.py", line 250, in async_maybe_update_ha_state

await self._async_update_ha_state()


 "/usr/src/app/homeassistant/components/hue/sensor.py", line 23, in _async_update_ha_state

await self.async_update_ha_state(self, *args, **kwargs)


 "/usr/src/app/homeassistant/helpers/entity.py", line 225, in async_update_ha_state

self._async_write_ha_state()


 "/usr/src/app/homeassistant/helpers/entity.py", line 248, in _async_write_ha_state

state = self.state


 "/usr/src/app/homeassistant/components/hue/sensor.py", line 40, in state

return 10 ** ((self.sensor.lightlevel - 1) / 10000)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Traceback (most recent call last):


 "mr_word_count.py", line 18, in <module>

MRWordFrequencyCount.run()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 616, in run

cls().execute()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 687, in execute

self.run_job()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 636, in run_job

runner.run()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/runner.py", line 497, in run

self._run()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 160, in _run

self._run_step(step, step_num)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 169, in _run_step

self._run_streaming_step(step, step_num)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 180, in _run_streaming_step

self._run_mappers_and_combiners(step_num, map_splits)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 221, in _run_mappers_and_combiners

for task_num, map_split in enumerate(map_splits)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 129, in _run_multiple

func()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 723, in _run_mapper_and_combiner

run_mapper()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/sim.py", line 746, in _run_task

stdin, stdout, stderr, wd, env)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/inline.py", line 132, in invoke_task

task.execute()


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 675, in execute

self.run_mapper(self.options.step_num)


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 760, in run_mapper

for k, v in self.map_pairs(read_lines(), step_num=step_num):


 "/home/ec2-user/.local/lib/python3.7/site-packages/mrjob/job.py", line 830, in map_pairs

for k, v in mapper(key, value) or ():


 "mr_word_count.py", line 8, in mapper

warnings.warn('Here is a warning')


 "/usr/lib64/python3.7/warnings.py", line 112, in _showwarnmsg

_showwarnmsg_impl(msg)


 "/usr/lib64/python3.7/warnings.py", line 30, in _showwarnmsg_impl

file.write(text)
TypeError: a bytes-like object is required, not 'str'
