Armed police were deployed to the scene after a gun was fired at a house in West Yorkshire.